Unique id for title bar and return false for handleToggle and 
.handleOpenUserPrefsDialog
----------------------------------------------------------------------------------------

                 Key: SHINDIG-61
                 URL: https://issues.apache.org/jira/browse/SHINDIG-61
             Project: Shindig
          Issue Type: Improvement
          Components: Javascript
         Environment: All
            Reporter: Martin Webb
            Assignee: Kevin Brown
            Priority: Minor


The following patch adds:

* a unique id to the title bar to allow container developers to add drag and 
drop support on the titlebar
* return false on both the settings and toggle onClick event handlers to stop 
the browser from repositioning the page to any # anchor tag

This patch superceeds https://issues.apache.org/jira/browse/SHINDIG-2 - which 
supplied this patch plus other items not perhaps suitable for shindig right now.


Index: javascript/container/gadgets.js
===================================================================
--- javascript/container/gadgets.js     (revision 627678)
+++ javascript/container/gadgets.js     (working copy)
@@ -455,14 +455,15 @@
 gadgets.IfrGadget.prototype.cssClassGadgetContent = 'gadgets-gadget-content';
 
 gadgets.IfrGadget.prototype.getTitleBarContent = function(continuation) {
-  continuation('<div class="' + this.cssClassTitleBar + '"><span id="' +
+  continuation('<div id="' + this.cssClassTitleBar + '-' + this.id +
+      '" class="' + this.cssClassTitleBar + '"><span id="' +
       this.getIframeId() + '_title" class="' +
-      this.cssClassTitle + '">Title</span> | <span class="' +
+      this.cssClassTitle + '">' + (this.title ? this.title : 'Title') + 
'</span> | <span class="' +
       this.cssClassTitleButtonBar +
       '"><a href="#" onclick="gadgets.container.getGadget(' + this.id +
-      ').handleOpenUserPrefsDialog()" class="' + this.cssClassTitleButton +
+      ').handleOpenUserPrefsDialog();return false" class="' + 
this.cssClassTitleButton +
       '">settings</a> <a href="#" onclick="gadgets.container.getGadget(' +
-      this.id + ').handleToggle()" class="' + this.cssClassTitleButton +
+      this.id + ').handleToggle();return false" class="' + 
this.cssClassTitleButton +
       '">toggle</a></span></div>');
 };
 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to