fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Literówka - zamiast self powinno byæ this.
[redakcja.git]
/
project
/
static
/
js
/
editor.js
diff --git
a/project/static/js/editor.js
b/project/static/js/editor.js
index
36dfcf2
..
69c27b1
100644
(file)
--- a/
project/static/js/editor.js
+++ b/
project/static/js/editor.js
@@
-45,7
+45,7
@@
Panel.prototype.callHook = function() {
var noHookAction = args.splice(0,1)[0]
var result = false;
var noHookAction = args.splice(0,1)[0]
var result = false;
-
//
$.log('calling hook: ', hookName, 'with args: ', args);
+ $.log('calling hook: ', hookName, 'with args: ', args);
if(this.hooks && this.hooks[hookName])
result = this.hooks[hookName].apply(this, args);
else if (noHookAction instanceof Function)
if(this.hooks && this.hooks[hookName])
result = this.hooks[hookName].apply(this, args);
else if (noHookAction instanceof Function)
@@
-53,6
+53,12
@@
Panel.prototype.callHook = function() {
return result;
}
return result;
}
+Panel.prototype._endload = function () {
+ // this needs to be here, so we
+ this.connectToolbar();
+ this.callHook('toolbarResized');
+}
+
Panel.prototype.load = function (url) {
// $.log('preparing xhr load: ', this.wrap);
$(document).trigger('panel:unload', this);
Panel.prototype.load = function (url) {
// $.log('preparing xhr load: ', this.wrap);
$(document).trigger('panel:unload', this);
@@
-66,14
+72,12
@@
Panel.prototype.load = function (url) {
panel_hooks = null;
$(self.contentDiv).html(data);
self.hooks = panel_hooks;
panel_hooks = null;
$(self.contentDiv).html(data);
self.hooks = panel_hooks;
- panel_hooks = null;
- self.connectToolbar();
- self.callHook('load');
- self.callHook('toolbarResized');
+ panel_hooks = null;
+ self.callHook('load');
},
error: function(request, textStatus, errorThrown) {
$.log('ajax', url, this.target, 'error:', textStatus, errorThrown);
},
error: function(request, textStatus, errorThrown) {
$.log('ajax', url, this.target, 'error:', textStatus, errorThrown);
- $(self.contentDiv).html("<p>Wystapił błąd podczas wczytywania panelu.");
+ $(self.contentDiv).html("<p>Wystapił błąd podczas wczytywania panelu.
</p>
");
}
});
}
}
});
}
@@
-142,6
+146,7
@@
Panel.prototype.connectToolbar = function()
var extra_buttons = $('span.panel-toolbar-extra', toolbar);
var placeholder = $('div.panel-toolbar span.panel-toolbar-extra', this.wrap);
placeholder.replaceWith(extra_buttons);
var extra_buttons = $('span.panel-toolbar-extra', toolbar);
var placeholder = $('div.panel-toolbar span.panel-toolbar-extra', this.wrap);
placeholder.replaceWith(extra_buttons);
+ extra_buttons.hide();
var action_buttons = $('button', extra_buttons);
var action_buttons = $('button', extra_buttons);
@@
-310,9
+315,11
@@
Editor.prototype.loadPanelOptions = function() {
totalWidth += panelWidth;
}
$.log('panel:', this, $(this).css('left'));
totalWidth += panelWidth;
}
$.log('panel:', this, $(this).css('left'));
- $('.panel-toolbar select', this).val(
- $('.panel-toolbar option[name=' + self.options.panels[index].name + ']', this).attr('value')
- )
+ $('.panel-toolbar option', this).each(function() {
+ if ($(this).attr('p:panel-name') == self.options.panels[index].name) {
+ $(this).parent('select').val($(this).attr('value'));
+ }
+ });
});
}
});
}
@@
-321,7
+328,7
@@
Editor.prototype.savePanelOptions = function() {
var panels = [];
$('.panel-wrap', self.rootDiv).not('.panel-content-overlay').each(function() {
panels.push({
var panels = [];
$('.panel-wrap', self.rootDiv).not('.panel-content-overlay').each(function() {
panels.push({
- name: $('.panel-toolbar option:selected', this).attr('name'),
+ name: $('.panel-toolbar option:selected', this).attr('
p:panel-
name'),
ratio: $(this).width() / self.rootDiv.width()
})
});
ratio: $(this).width() / self.rootDiv.width()
})
});
@@
-375,9
+382,8
@@
Editor.prototype.saveToBranch = function(msg)
}
else {
self.refreshPanels();
}
else {
self.refreshPanels();
- $('#toolbar-button-save').attr('disabled', 'disabled');
- $('#toolbar-button-commit').removeAttr('disabled');
- $('#toolbar-button-update').removeAttr('disabled');
+
+
if(self.autosaveTimer)
clearTimeout(self.autosaveTimer);
if(self.autosaveTimer)
clearTimeout(self.autosaveTimer);