Sha256: b83ccc66933bb06f8fe990e689e0603cfdcc3fa20051e882561f374978d9e785
Contents?: true
Size: 916 Bytes
Versions: 8
Compression:
Stored size: 916 Bytes
Contents
// // More // Rad.More = new Class({ initialize: function(element){ this.element = element; var id = this.element.getData('id'); this.core = $(id + '_core'); this.more = $(id + '_more'); if(!this.more) console.log("Rad.More: no content for '" + id + "'!"); // add event to button element.addEvent('click', function(event){ event.stop(); Rad.More.opened_containers[id] = true; this._show(); }.bind(this)); // if opened once, keep it open in all next ajax updates if(Rad.More.opened_containers[id]) this._show(); }, _show: function(){ this.more.getChildren().reverse().each(function(e){ e.inject(this.element, 'after'); }.bind(this)); if(this.core) this.core.destroy(); this.more.destroy(); this.element.destroy(); window.fireEvent('updateStyle'); } }); Rad.More.opened_containers = {};
Version data entries
8 entries across 8 versions & 1 rubygems