lib/netzke/window.rb in netzke-basepack-0.5.5.1 vs lib/netzke/window.rb in netzke-basepack-0.5.6

- old
+ new

@@ -16,17 +16,20 @@ "Ext.Window" end # Set the passed item as the only aggregatee def initial_aggregatees - {:item => config[:item]} + res = {} + res.merge!(:item => config[:item]) if config[:item] + res end # Extends the JavaScript class def self.js_extend_properties { :layout => "fit", + :init_component => <<-END_OF_JAVASCRIPT.l, function(){ // Width and height may be specified as percentage of available space, e.g. "60%". // Convert them into actual pixels. Ext.each(["width", "length"], function(k){ @@ -39,12 +42,15 @@ #{js_full_class_name}.superclass.initComponent.call(this); // Set the move and resize events after window is shown, so that they don't fire at initial rendering this.on("show", function(){ this.on("move", this.onMove, this); - this.on("resize", this.onSelfResize, this, {buffer: 50}); // Work around firing "resize" event twice (currently a bug in ExtJS) + this.on("resize", this.onSelfResize, this); // Work around firing "resize" event twice (currently a bug in ExtJS) }, this); - this.instantiateChild(this.itemConfig); + + if (this.itemConfig){ + this.instantiateChild(this.itemConfig); + } } END_OF_JAVASCRIPT :on_move => <<-END_OF_JAVASCRIPT.l, function(w,x,y){ \ No newline at end of file