Author: eallen
Date: 2009-04-30 11:10:19 -0400 (Thu, 30 Apr 2009)
New Revision: 3350
Modified:
mgmt/trunk/cumin/resources/app.js
Log:
Move fullpageable script to cumin.
Don't make hidden widgets fullpagable.
Modified: mgmt/trunk/cumin/resources/app.js
===================================================================
--- mgmt/trunk/cumin/resources/app.js 2009-04-30 13:53:19 UTC (rev 3349)
+++ mgmt/trunk/cumin/resources/app.js 2009-04-30 15:10:19 UTC (rev 3350)
@@ -95,6 +95,46 @@
}
}
+ this.makeFullPageable = function (element) {
+ if (element.getElement(".fullpageTitle"))
+ return; // already fullpaged
+
+ element.removeClass('fullpageable');
+ var outer = new Element('div', {'class':
'fullpageable'});
+ var titleBack = new Element('div', {'class':
'fullpageTitle'});
+ var titleBar = new Element('div', {'class':
'fullpageTitleBar',
+ 'events': {'dblclick': function () {fullpage(this);}}});
+ var icon = new Element('p', {'class': 'fullpageIcon',
+ 'title': 'Full Page',
+ 'events': {'click': function () {fullpage(this);}}});
+ var container = new Element('div', {'class':
'widgetContainer'});
+
+ outer.appendChild(titleBack);
+ outer.appendChild(titleBar);
+ outer.appendChild(icon);
+ outer.appendChild(container);
+
+ var parent = element.parentNode;
+ outer.originalParent = parent;
+ container.appendChild(element);
+
+ parent.appendChild(outer);
+
+ var widgets = element.getElements('.fullpage_notify');
+ outer.widgetPaths = [];
+ widgets.each(function (widget) {
+ if (widget.get("id")) {
+ outer.widgetPaths.push(widget.get("id"));
+ }
+ });
+
+ if (element.onfullpage) {
+ outer.onfullpage = element.onfullpage;
+ }
+ if (element.onrestore) {
+ outer.onrestore = element.onrestore;
+ }
+ }
}
}())
@@ -105,41 +145,9 @@
for (var i=0; i<elements.length; i++) {
var element = elements[i];
- element.removeClass('fullpageable');
- var outer = new Element('div', {'class':
'fullpageable'});
- var titleBack = new Element('div', {'class':
'fullpageTitle'});
- var titleBar = new Element('div', {'class':
'fullpageTitleBar',
- 'events': {'dblclick': function () {fullpage(this);}}});
- var icon = new Element('p', {'class': 'fullpageIcon',
- 'title': 'Full Page',
- 'events': {'click': function () {fullpage(this);}}});
- var container = new Element('div', {'class':
'widgetContainer'});
-
- outer.appendChild(titleBack);
- outer.appendChild(titleBar);
- outer.appendChild(icon);
- outer.appendChild(container);
-
- var parent = element.parentNode;
- outer.originalParent = parent;
- container.appendChild(element);
-
- parent.appendChild(outer);
-
- var widgets = element.getElements('.fullpage_notify');
- outer.widgetPaths = [];
- widgets.each(function (widget) {
- if (widget.get("id")) {
- outer.widgetPaths.push(widget.get("id"));
- }
- });
-
- if (element.onfullpage) {
- outer.onfullpage = element.onfullpage;
+ if (element.getStyle("visibility") == "visible") {
+ cumin.makeFullPageable(element);
}
- if (element.onrestore) {
- outer.onrestore = element.onrestore;
- }
}
});
Show replies by date