Switch to strict mode
authorThierry Florac <thierry.florac@onf.fr>
Tue, 16 May 2017 11:41:01 +0200
changeset 27 4d2f97a5b165
parent 26 fed07be83b9a
child 28 874cc6118634
Switch to strict mode
src/pyams_workflow/resources/js/workflow.js
src/pyams_workflow/resources/js/workflow.min.js
--- a/src/pyams_workflow/resources/js/workflow.js	Tue Nov 15 10:45:15 2016 +0100
+++ b/src/pyams_workflow/resources/js/workflow.js	Tue May 16 11:41:01 2017 +0200
@@ -1,6 +1,9 @@
-(function($) {
+(function($, globals) {
 
-	window.PyAMS_workflow = {
+	'use strict';
+
+	var MyAMS = globals.MyAMS;
+	var PyAMS_workflow = {
 
 		/**
 		 * Versions list management
@@ -19,7 +22,7 @@
 						$(this).removeClass('fa-caret-down')
 							   .addClass('fa-caret-right');
 					}
-				}
+				};
 			},
 
 			switchAllVersions: function() {
@@ -42,9 +45,10 @@
 						$('i', link).removeClass('fa-caret-down')
 									.addClass('fa-caret-right');
 					}
-				}
+				};
 			}
 		}
 	};
+	globals.PyAMS_workflow = PyAMS_workflow;
 
-})(jQuery);
+})(jQuery, this);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_workflow/resources/js/workflow.min.js	Tue May 16 11:41:01 2017 +0200
@@ -0,0 +1,1 @@
+(function(c,b){var d=b.MyAMS;var a={versions_list:{switchVersions:function(){return function(){var e=c(this).siblings("ul.versions");if(e.hasClass("hidden")){e.removeClass("hidden");c(this).removeClass("fa-caret-right").addClass("fa-caret-down")}else{e.addClass("hidden");c(this).removeClass("fa-caret-down").addClass("fa-caret-right")}}},switchAllVersions:function(){return function(){var g=c(this);var e=g.siblings("ul.old_versions");if(e.hasClass("hidden")){c("i",g).removeClass("fa-caret-right").addClass("fa-spin fa-gear");var f=g.parents("[data-ams-location]").data("ams-location");var h=g.parents("tr").data("ams-element-name");d.skin.loadURL(f+"/get-old-versions.html?element_name="+h,e,{afterLoadCallback:function(){c("i",g).removeClass("fa-spin fa-gear").addClass("fa-caret-down")}})}else{e.addClass("hidden");c("i",g).removeClass("fa-caret-down").addClass("fa-caret-right")}}}}};b.PyAMS_workflow=a})(jQuery,this);
\ No newline at end of file