Author: lindner
Date: Mon Mar  3 13:48:31 2008
New Revision: 633287

URL: http://svn.apache.org/viewvc?rev=633287&view=rev
Log:
Apply Patch from Martin Webb for SHINDIG-61.  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
* Allow the container to set a default title

Modified:
    incubator/shindig/trunk/javascript/container/gadgets.js

Modified: incubator/shindig/trunk/javascript/container/gadgets.js
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/gadgets.js?rev=633287&r1=633286&r2=633287&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/gadgets.js (original)
+++ incubator/shindig/trunk/javascript/container/gadgets.js Mon Mar  3 13:48:31 
2008
@@ -461,14 +461,15 @@
 gadgets.IfrGadget.prototype.rpcRelay = 'files/rpc_relay.html';
 
 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>');
 };
 


Reply via email to