diff --git a/platform/features/notebook/bundle.js b/platform/features/notebook/bundle.js index 1cd18052fb..02c17c7e3e 100644 --- a/platform/features/notebook/bundle.js +++ b/platform/features/notebook/bundle.js @@ -58,7 +58,8 @@ define([ "model": { "entries": [], "composition": [], - "entryTypes": [] + "entryTypes": [], + "defaultSort": "-createdOn" }, "properties": [ { @@ -236,7 +237,6 @@ define([ "cssClass": "icon-notebook labeled", "description": "Add a new Notebook entry", "category": [ - "contextual", "view-control" ], "depends": [ @@ -252,13 +252,13 @@ define([ "licenses": [ { "name": "painterro", - "version": "4.1.0", - "author": "Mike Bostock", - "description": "D3 (or D3.js) is a JavaScript library for visualizing data using web standards. D3 helps you bring data to life using SVG, Canvas and HTML. D3 combines powerful visualization and interaction techniques with a data-driven approach to DOM manipulation, giving you the full capabilities of modern browsers and the freedom to design the right visual interface for your data.", - "website": "https://d3js.org/", - "copyright": "Copyright 2010-2016 Mike Bostock", - "license": "BSD-3-Clause", - "link": "https://github.com/d3/d3/blob/master/LICENSE" + "version": "0.2.65", + "author": "Ivan Borshchov", + "description": "Painterro is JavaScript paint widget which allows editing images directly in a browser.", + "website": "https://github.com/ivictbor/painterro", + "copyright": "Copyright 2017 Ivan Borshchov", + "license": "MIT", + "link": "https://github.com/ivictbor/painterro/blob/master/LICENSE" } ], "capabilities": [ diff --git a/platform/features/notebook/src/actions/NewEntryContextual.js b/platform/features/notebook/src/actions/NewEntryContextual.js index 70e7edaf2e..a6ad6851e0 100644 --- a/platform/features/notebook/src/actions/NewEntryContextual.js +++ b/platform/features/notebook/src/actions/NewEntryContextual.js @@ -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; diff --git a/platform/features/notebook/src/controllers/NotebookController.js b/platform/features/notebook/src/controllers/NotebookController.js index 5c187b10e6..720d8379f9 100644 --- a/platform/features/notebook/src/controllers/NotebookController.js +++ b/platform/features/notebook/src/controllers/NotebookController.js @@ -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 () {}); diff --git a/platform/features/notebook/src/directives/MCTSnapshot.js b/platform/features/notebook/src/directives/MCTSnapshot.js index 58ef585afc..ff0188abbe 100644 --- a/platform/features/notebook/src/directives/MCTSnapshot.js +++ b/platform/features/notebook/src/directives/MCTSnapshot.js @@ -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;