Fixes initial part with legacy trees and legacy actions - now a modal window can launch - but now we need to get the legacy umb client manager js tree stuff hooked in.
This commit is contained in:
@@ -204,7 +204,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
|
||||
|
||||
//get our angular navigation service
|
||||
var injector = getRootInjector();
|
||||
var dialogService = injector.get("dialogService");
|
||||
var dialogService = injector.get("dialogService");
|
||||
|
||||
var self = this;
|
||||
|
||||
@@ -219,12 +219,14 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
|
||||
//add the callback to the jquery data for the modal so we can call it on close to support the legacy way dialogs worked.
|
||||
dialog.element.data("modalCb", onCloseCallback);
|
||||
//add the close triggers
|
||||
for (var i = 0; i < closeTriggers.length; i++) {
|
||||
var e = dialog.find(closeTriggers[i]);
|
||||
if (e.length > 0) {
|
||||
e.click(function() {
|
||||
self.closeModalWindow();
|
||||
});
|
||||
if (angular.isArray(closeTriggers)) {
|
||||
for (var i = 0; i < closeTriggers.length; i++) {
|
||||
var e = dialog.find(closeTriggers[i]);
|
||||
if (e.length > 0) {
|
||||
e.click(function () {
|
||||
self.closeModalWindow();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,25 +15,31 @@ angular.module("umbraco.directives")
|
||||
//we'll try to get the jsAction from the injector
|
||||
var menuAction = action.metaData["jsAction"].split('.');
|
||||
if (menuAction.length !== 2) {
|
||||
throw "The jsAction assigned to a menu action must have two parts delimited by a '.' ";
|
||||
}
|
||||
|
||||
var service = $injector.get(menuAction[0]);
|
||||
if (!service) {
|
||||
throw "The angular service " + menuAction[0] + " could not be found";
|
||||
}
|
||||
//if it is not two parts long then this most likely means that it's a legacy action
|
||||
var js = action.metaData["jsAction"];
|
||||
//there's not really a different way to acheive this except for eval
|
||||
eval(js);
|
||||
|
||||
var method = service[menuAction[1]];
|
||||
|
||||
if (!method) {
|
||||
throw "The method " + menuAction[1] + " on the angular service " + menuAction[0] + " could not be found";
|
||||
}
|
||||
else {
|
||||
var service = $injector.get(menuAction[0]);
|
||||
if (!service) {
|
||||
throw "The angular service " + menuAction[0] + " could not be found";
|
||||
}
|
||||
|
||||
method.apply(this, [{
|
||||
treeNode: currentNode,
|
||||
action: action,
|
||||
section: currentSection
|
||||
}]);
|
||||
var method = service[menuAction[1]];
|
||||
|
||||
if (!method) {
|
||||
throw "The method " + menuAction[1] + " on the angular service " + menuAction[0] + " could not be found";
|
||||
}
|
||||
|
||||
method.apply(this, [{
|
||||
treeNode: currentNode,
|
||||
action: action,
|
||||
section: currentSection
|
||||
}]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//by default we launch the dialog
|
||||
|
||||
Reference in New Issue
Block a user