From 54dcccb4720b61cfa18c9cf15439f451df65ce3e Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Tue, 2 Aug 2016 14:37:32 -0700 Subject: [PATCH 1/3] [Documentation] Add mention of new API to README Added two paragraphs to the readme mentioning the ongoing API work with a link to the tracking task. The website will also link to this. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e2d3a979d9..cce52a9921 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ Please visit our [Official Site](https://nasa.github.io/openmct/) and [Getting S Try Open MCT now with our [live demo](https://openmct-demo.herokuapp.com/). ![Demo](https://nasa.github.io/openmct/static/res/images/Open-MCT.Browse.Layout.Mars-Weather-1.jpg) +## New API +A new API is currently under development that will deprecate a lot of the documentation currently in the docs directory, however Open MCT will remain compatible with the currently documented API. An updated set of tutorials is being developed with the new API, and progress on this task can be followed in the [associated pull request](https://github.com/nasa/openmct/pull/999). Any code in this branch should be considered experimental, and we welcome any feedback. + +Differences between the two APIs include a move away from a declarative system of JSON configuration files towards an imperative system based on function calls. Developers will be able to extend and build on Open MCT by making direct function calls to a public API. Open MCT is also being refactored to minimize the dependencies that using Open MCT imposes on developers, such as the current requirement to use Angular JS. + ## Building and Running Open MCT Locally Building and running Open MCT in your local dev environment is very easy. Be sure you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed, then follow the directions below. Need additional information? Check out the [Getting Started](https://nasa.github.io/openmct/getting-started/) page on our website. From 0274490b68ec21afdc38e9aba5e3f416ae55fca8 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 5 Aug 2016 16:30:20 -0700 Subject: [PATCH 2/3] [search] Reverted previous change to ClickAwayController and introduced a custom fix to search menu. Fixes #888 (#1109) --- platform/commonUI/general/bundle.js | 2 +- .../src/controllers/ClickAwayController.js | 4 ++-- .../general/src/controllers/ToggleController.js | 2 ++ .../test/controllers/ClickAwayControllerSpec.js | 16 +++++++++------- platform/search/res/templates/search-menu.html | 4 ++-- platform/search/res/templates/search.html | 10 +++++++--- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/platform/commonUI/general/bundle.js b/platform/commonUI/general/bundle.js index b2eccc1732..1ec3c5a1f4 100644 --- a/platform/commonUI/general/bundle.js +++ b/platform/commonUI/general/bundle.js @@ -259,7 +259,7 @@ define([ "implementation": ClickAwayController, "depends": [ "$document", - "$scope" + "$timeout" ] }, { diff --git a/platform/commonUI/general/src/controllers/ClickAwayController.js b/platform/commonUI/general/src/controllers/ClickAwayController.js index 94ae71c2ea..6a01c528e9 100644 --- a/platform/commonUI/general/src/controllers/ClickAwayController.js +++ b/platform/commonUI/general/src/controllers/ClickAwayController.js @@ -34,7 +34,7 @@ define( * @param $scope the scope in which this controller is active * @param $document the document element, injected by Angular */ - function ClickAwayController($document, $scope) { + function ClickAwayController($document, $timeout) { var self = this; this.state = false; @@ -44,7 +44,7 @@ define( // `clickaway` action occurs after `toggle` if `toggle` is // triggered by a click/mouseup. this.clickaway = function () { - $scope.$apply(function () { + $timeout(function () { self.deactivate(); }); }; diff --git a/platform/commonUI/general/src/controllers/ToggleController.js b/platform/commonUI/general/src/controllers/ToggleController.js index 728d912c9a..8930c7fef2 100644 --- a/platform/commonUI/general/src/controllers/ToggleController.js +++ b/platform/commonUI/general/src/controllers/ToggleController.js @@ -33,6 +33,8 @@ define( */ function ToggleController() { this.state = false; + + this.setState = this.setState.bind(this); } /** diff --git a/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js b/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js index 8edf90e2c6..22b4035919 100644 --- a/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js +++ b/platform/commonUI/general/test/controllers/ClickAwayControllerSpec.js @@ -26,7 +26,7 @@ define( describe("The click-away controller", function () { var mockDocument, - mockScope, + mockTimeout, controller; beforeEach(function () { @@ -34,11 +34,10 @@ define( "$document", ["on", "off"] ); - mockScope = jasmine.createSpyObj('$scope', ['$apply']); - + mockTimeout = jasmine.createSpy('timeout'); controller = new ClickAwayController( mockDocument, - mockScope + mockTimeout ); }); @@ -78,15 +77,18 @@ define( }); it("deactivates and detaches listener on document click", function () { - var callback, apply; + var callback, timeout; controller.setState(true); callback = mockDocument.on.mostRecentCall.args[1]; callback(); - apply = mockScope.$apply.mostRecentCall.args[0]; - apply(); + timeout = mockTimeout.mostRecentCall.args[0]; + timeout(); expect(controller.isActive()).toEqual(false); expect(mockDocument.off).toHaveBeenCalledWith("mouseup", callback); }); + + + }); } ); diff --git a/platform/search/res/templates/search-menu.html b/platform/search/res/templates/search-menu.html index e051071f0d..daa350a77b 100644 --- a/platform/search/res/templates/search-menu.html +++ b/platform/search/res/templates/search-menu.html @@ -22,13 +22,13 @@
-