X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/b363e4352ce32f4518b5e5bb794635074d5f6ba6..4f9f0e6fbf1be3805f9995c536a583eda1260bee:/project/static/js/views/view.js?ds=sidebyside diff --git a/project/static/js/views/view.js b/project/static/js/views/view.js index 52fc6e04..bc8266c1 100644 --- a/project/static/js/views/view.js +++ b/project/static/js/views/view.js @@ -7,25 +7,33 @@ var View = Editor.Object.extend({ overlayClass: 'view-overlay', overlay: null, - init: function(element, model, template) { + init: function(element, model, template) + { + console.log("init for view"); this.element = $(element); this.model = model; this.template = template || this.template; - if (this.template) { - this.element.html(render_template(this.template, this)); - } + if (this.template) this.render(); this._resizeHandler = this.resized.bind(this); $(window).bind('resize', this._resizeHandler); $(this.element).bind('resize', this._resizeHandler); }, + + render: function() { + console.log('rendering:', this._className); + this.element.html(render_template(this.template, this)); + }, frozen: function() { return !!this.overlay; }, freeze: function(message) { + if (this.frozen()) { + this.unfreeze(); + } this.overlay = this.overlay || $('