Merge "Provide callback feature when modal is visible"
authorAndrew Kim <andrekim@cisco.com>
Thu, 23 Jan 2014 23:33:23 +0000 (23:33 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 23 Jan 2014 23:33:23 +0000 (23:33 +0000)
opendaylight/web/devices/src/main/resources/js/page.js

index 855dc90aa9023208b41168c384806db16d86dae5..935354e304b204fb31ba1947424ef7912c3c6c02 100644 (file)
@@ -127,6 +127,7 @@ one.f.switchmanager.nodesLearnt = {
     }
   },
   modal : {
+    registry : { callback:undefined },
     initialize: {
       updateNode: function(evt) {
         one.f.switchmanager.nodesLearnt.ajax.main(one.f.switchmanager.rootUrl + "/tiers", function(tiers) {
@@ -151,7 +152,13 @@ one.f.switchmanager.nodesLearnt = {
 
           // inject body (nodePorts)
           one.lib.modal.inject.body($modal, $body);
-          $modal.modal();
+
+          $modal.modal().on("shown",function() {
+              var callback = one.f.switchmanager.nodesLearnt.modal.registry.callback;
+              if( callback !== undefined && $.isFunction(callback)) {
+                 callback();
+              }
+          });
         });
       },
       popout: function() {