changeset 1523:debdc9fdf48f

init hook for digilib plugin to initialize nested options
author hertzhaft
date Sun, 04 Sep 2016 12:55:08 +0200
parents 3709c60f4c2e
children 4eaf3509f407
files webapp/src/main/webapp/jquery/jquery.digilib.js
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.js	Sun Aug 28 01:28:49 2016 +0200
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.js	Sun Sep 04 12:55:08 2016 +0200
@@ -125,7 +125,7 @@
          * @param options
          * @returns
          */
-        init : function(options) {
+        init : function(options, hook) {
             // import geometry classes
             if (plugins.geometry == null) {
                 $.error("jquery.digilib.geometry plugin not found!");
@@ -260,6 +260,11 @@
                 }
                 // create HTML structure for scaler
                 setupScalerDiv(data);
+                // additional initializations before setup (e.g. for single nested settings)
+                if (typeof hook === 'function') {
+                  hook(data);
+                  console.debug('init hook', hook, data);
+                }
                 // send setup event
                 $(data).trigger('setup');
             });