[Notebook] Snapshot overlay - fixes issues #2098 #2102 #2108 #2110 (#2113)

* snapshot - when taking a snapshot of overlay, select object-holder vs the entire overlay. This fixes plots not being captured

* remove new Notebook entry from context menu - fixes issue #2098

* add licence information for Painterro - fixes issue #2108

* add watch for defaultSort - fixes issue 2102

* dont allow snapshot action from imagery

* fix checkstyle error
This commit is contained in:
Deep Tailor
2018-07-17 11:30:01 -07:00
committed by Pete Richards
parent d7eb4c17ca
commit 5af14cd3b9
4 changed files with 28 additions and 12 deletions

View File

@ -185,7 +185,18 @@ define(
NewEntryContextual.appliesTo = function (context) {
var domainObject = context.domainObject;
return !!(domainObject && domainObject.getModel().type !== 'notebook');
if (domainObject) {
if (domainObject.getModel().type === 'Notebook') {
// do not allow in context of a notebook
return false;
} else if (domainObject.getModel().type.includes('imagery')) {
// do not allow in the context of an object with imagery
// (because of cross domain issue with snapshot)
return false;
}
}
return true;
};
return NewEntryContextual;

View File

@ -42,7 +42,7 @@ define(
) {
$scope.entriesEl = $(document.body).find('.t-entries-list');
$scope.sortEntries = $scope.domainObject.getModel().defaultSort || "-createdOn";
$scope.sortEntries = $scope.domainObject.getModel().defaultSort;
$scope.showTime = "0";
$scope.editEntry = false;
$scope.entrySearch = '';
@ -354,6 +354,11 @@ define(
$scope.$watchCollection("composition", refreshComp);
$scope.$watch('domainObject.getModel().defaultSort', function (newDefaultSort, oldDefaultSort) {
if (newDefaultSort !== oldDefaultSort) {
$scope.sortEntries = newDefaultSort;
}
});
$scope.$on('$destroy', function () {});

View File

@ -25,7 +25,7 @@ define(['zepto'], function ($) {
var document = $document[0];
function link($scope, $element, $attrs) {
var objectElement = $(document.body).find('.overlay')[0] || $(document.body).find("[key='representation.selected.key']")[0],
var objectElement = $(document.body).find(".overlay .object-holder")[0] || $(document.body).find("[key='representation.selected.key']")[0],
takeSnapshot,
makeImg,
saveImg;