Permalink
Browse files

small docs update

  • Loading branch information...
bogdan-bugarschi committed Jul 21, 2014
1 parent 225fb0a commit 131da484dc5b375c22eb3d5ab2fdfd471a8b5825
Showing with 33 additions and 4 deletions.
  1. +4 −4 doc/BasicControlScript.js
  2. +29 −0 doc/BasicControlScript.static.js
@@ -7,7 +7,7 @@
* Invoked before the element is updated.
*/
beforeUpdate: function() {
-
+ //BasicControlScript.beforeUpdate(element, $control.buildJsonOptions()); //see BasicControlScript.static.js
},
/**
@@ -17,20 +17,20 @@
* true, to prevent the update.
*/
doUpdate: function(element) {
- return false;
+ return false;;//or optionally return BasicControlScript.doUpdate(element, $control.buildJsonOptions()); //see BasicControlScript.static.js
},
/**
* Invoked after the DOM element was updated. This function is NOT updated if
* the custom doUpdate function returned true.
*/
afterUpdate: function(element) {
-
+ //BasicControlScript.afterUpdate(element, $control.buildJsonOptions()); //see BasicControlScript.static.js
},
/**
* Invoked when the existing element is removed from the DOM tree.
*/
destroy : function(element) {
-
+ //BasicControlScript.destroy(element, $control.buildJsonOptions()); //see BasicControlScript.static.js
}
}
@@ -0,0 +1,29 @@
+/**
+ * This is a basic construct of static javascript files.
+ * This file is loaded only once, therefore the BasicControlScript object is as global 'singleton'
+ * Note that these kind of control should be placed in a namespace-like structure to avoid global object pollution
+ *
+ * The callback methods reflect the method defined in the BasicControlScript.js for easy reading, but this is not necessary
+ *
+ */
+var BasicControlScript = (function($, jWic, undefined){
+ "use strict";
+ //private methods
+
+ //public API goes here
+ return {
+ beforeUpdate : function(control, options){
+
+ },
+ doUpdate : function(control, options){
+ return false;
+ },
+ afterUpdate : function(control, options){
+
+ },
+ destroy : function(control, options){
+
+ }
+ }
+
+}(jQuery, JWic));// dependencies

0 comments on commit 131da48

Please sign in to comment.