X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fargeo-ria-src%2Fclass%2Forg%2Fargeo%2Fria%2FApplication.js;h=a1e5901f18802149bf3ac692af8ec7ea8e71c8ab;hb=3e24f32c95b5ac3ec7fcae7000c4a8cfb857d514;hp=4609bad1eb0c0e765bac05173974d76f7d5d3fa1;hpb=9fa32e016b61bccc61ae7aff9c70beec9e68f9e6;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js index 4609bad1e..a1e5901f1 100644 --- a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js +++ b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/Application.js @@ -26,17 +26,29 @@ qx.Class.define("org.argeo.ria.Application", }, properties : { + /** + * Available perspective detected in the current compilation. + */ perspectives : { check : "Map", init : {} }, + /** + * Currently layouted perspective label + */ activePerspectiveName : { check : "String", init : "" }, + /** + * Currently layouted perspective. + */ activePerspective : { init : null }, + /** + * Basic command associated to the application, applicable to all perspectives. + */ commandsDefinitions : { init : { "stop" : { @@ -191,6 +203,10 @@ qx.Class.define("org.argeo.ria.Application", this.loadPerspective(); }, + /** + * Load a given perspective by its name. + * @param perspectiveName {String} Perspective to load + */ loadPerspective : function(perspectiveName){ if(perspectiveName){ this.setActivePerspectiveName(perspectiveName); @@ -214,6 +230,9 @@ qx.Class.define("org.argeo.ria.Application", this.setActivePerspective(perspective); }, + /** + * After switching perspective, call this function to rebuild menu with the right selected. + */ rebuildPerspectiveMenus : function(){ var switchCommand = this.getCommandsDefinitions()["switchperspective"]; switchCommand.submenu = []; @@ -231,11 +250,24 @@ qx.Class.define("org.argeo.ria.Application", switchCommand.command.setMenu(switchCommand.submenu); } }, + + /** + * Specific action of calling an external URL without triggering the "close()" method + * of Application. + * @param hrefValue {String} A download url that should reply with specific "attachment" header to avoid leaving the application. + */ + javascriptDownloadLocation: function(hrefValue){ + this.interruptClose = true; + document.location.href = hrefValue; + this.interruptClose = false; + }, - terminate : function(){ - alert("toto"); + /** + * Called at Application ending (closing the browser). + */ + close : function(){ + if(this.interruptClose) return ; if(this.getActivePerspective()){ - alert(this.getActivePerspective()); this.getActivePerspective().remove(org.argeo.ria.components.ViewsManager.getInstance()); } this.base(arguments);