fullSizeEl : null,
search: null,
toolbar: null,
+ tools: null,
+ titlebar: null,
+ options: null,
configurationObj: null,
loadRequest : null,
repeaterEl: null,
gridEl: null,
checked: [],
objects: {},
+ windowSize: null,
size: {
- widthNormal : '437px',
+ widthNormal : '53%',
heightNormal : '325px',
- widthHalf : '437px',
+ widthHalf : '53%',
heightHalf : '586px',
- widthFull : '899px',
- heightFull : '586px'
+ widthFull : '100%',
+ heightFull : '586px',
+ menuWidth: '75px'
},
elements : {
contentItems : 'slide-window-element',
contentAlternatingItems : 'slide-window-element-alternating',
toolsButtonSuffix : '-slide-window-tools',
+ optionsButtonSuffix : '-slide-window-options',
actionsSuffix : '-slide-window-actions',
toolbarSuffix : '-slide-window-toolbar',
titleSuffix : '-slide-window-title'
this.windowId = windowId;
this.window = $(this.windowId + this.elements.containerSuffix);
this.tools = $(this.windowId + this.elements.toolsButtonSuffix);
-
+ this.options = $(this.windowId + this.elements.optionsButtonSuffix);
+ this.titlebar = $(this.windowId + this.elements.titleSuffix);
+
if(data.hasOwnProperty('showId')) {
this.showEl = $(data.showId);
} else {
this.resetSize();
}.bind(this));
+ this.titlebar.observe('dblclick', function() {
+ this.resetSize();
+ }.bind(this));
+
this.search.observe('keyup', function(){
this.setSearch();
}.bind(this));
this.tools.observe('click', function() {
this.toggleToolbar();
}.bind(this));
+
+ this.options.observe('click', function() {
+ this.toggleToolbar();
+ }.bind(this));
},
openWindow : function() {
}.bind(this)
});
},
+
+ isWindowOpen: function() {
+ return !(this.window.style.display === 'none');
+ },
resetSize : function() {
if(this.isConfigurationOpen()) {
},
isNormalSize: function() {
- return (this.window.getWidth() + 'px' == this.size.widthNormal && this.window.getHeight() + 'px' == this.size.heightNormal);
+ return (this.windowSize == this.size.widthNormal && this.window.getHeight() + 'px' == this.size.heightNormal);
},
isHalfSize: function() {
- return (this.window.getWidth() + 'px' == this.size.widthHalf && this.window.getHeight() + 'px' == this.size.heightHalf);
+ return (this.windowSize == this.size.widthHalf && this.window.getHeight() + 'px' == this.size.heightHalf);
},
isFullSize: function() {
- return (this.window.getWidth() + 'px' == this.size.widthFull && this.window.getHeight() + 'px' == this.size.heightFull);
+ return (this.windowSize == this.size.widthFull && this.window.getHeight() + 'px' == this.size.heightFull);
},
normalSizeWindow: function() {
new Effect.Morph(this.window, {style : 'width: ' + this.size.widthNormal + '; height: ' + this.size.heightNormal + ';', duration : 0.4});
+ this.windowSize = this.size.widthNormal;
},
halfSizeWindow: function() {
new Effect.Morph(this.window, {style : 'width: ' + this.size.widthHalf + '; height: ' + this.size.heightHalf + ';', duration : 0.4});
+ this.windowSize = this.size.widthHalf;
},
fullSizeWindow: function() {
new Effect.Morph(this.window, {style : 'width: ' + this.size.widthFull + '; height: ' + this.size.heightFull + ';', duration : 0.4});
+ this.windowSize = this.size.widthFull;
},
hideOtherWindows: function() {
}
return reverse * (val);
});
- for(i = 0; i < tr.length; ++i) tb.appendChild(tr[i]);
+ for(i = 0; i < tr.length; i++) {
+ var even = ((i % 2) == 0);
+ if (even) {
+ tr[i].className = this.elements.contentItems;
+ } else {
+ tr[i].className = this.elements.contentAlternatingItems;
+ }
+ tb.appendChild(tr[i]);
+ }
},
makeSortable: function () {
} else {
return;
}
- while (--i >= 1) (function (i) {
+ var downCounter = 0;
+ // skip first column if in column header is input (checkbox for elements mark)
+ if (th[0].childNodes[0].nodeName == "INPUT") {
+ downCounter = 1;
+ }
+ while (--i >= downCounter) (function (i) {
var dir = 1;
th[i].addEventListener('click', function () {
self.sortTable(i, (dir = 1 - dir));
}.bind(search_pattern));
},
setElementsCount : function() {
- var title_el = $(this.windowId + this.elements.titleSuffix);
var elements_count = $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] div.' + this.elements.contentItems).length || $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] tr.' + this.elements.contentItems + ', div[id="' + this.windowId + this.elements.containerSuffix + '"] tr.' + this.elements.contentAlternatingItems).length;
var count_el = $(this.windowId + this.elements.titleSuffix).getElementsByTagName('span')[0];
$(count_el).update(' (' + elements_count + ')');
this.markChecked(containerId, ch.checked, ch.value);
}
}.bind(this));
- this.packChecked(containerId);
+ if (containerId) {
+ this.packChecked(containerId);
+ }
}
if(check) {
var SlideWindow = new SlideWindowClass()
document.observe("dom:loaded", function() {
- if(Prototype.Browser.IE || Prototype.Browser.Gecko) {
+ if(Prototype.Browser.IE || Prototype.Browser.Gecko || Prototype.Browser.WebKit) {
$$('input[type=checkbox], input[type=submit], input[type=radio], a').each(function(el) {
el.observe('focus', function() {
el.blur();
});
}
});
+
+function setContentWidth() {
+ var content_width = $('container').getWidth() - $('menu-left').getWidth() - 1;
+ $('content').setStyle({'width': content_width + 'px'});
+}
+
+
+Event.observe(window, 'resize', function() {
+ setContentWidth();
+});
+
+document.observe("dom:loaded", function() {
+ setContentWidth();
+});