$(this.contentDiv).html('');
// disconnect the toolbar
- $('div.panel-toolbar span.panel-toolbar-extra', this.wrap).empty();
+ $('div.panel-toolbar span.panel-toolbar-extra', this.wrap).html(
+ '<span />');
this.callHook('unload');
this.hooks = null; // flush the hooks
if(toolbar.length === 0) return;
// move the extra
- var extra_buttons = $('span.panel-toolbar-extra', toolbar);
- var placeholder = $('div.panel-toolbar span.panel-toolbar-extra', this.wrap);
- placeholder.replaceWith(extra_buttons);
- placeholder.hide();
-
- var action_buttons = $('button', extra_buttons);
+ var extra_buttons = $('span.panel-toolbar-extra button', toolbar);
+ var placeholder = $('div.panel-toolbar span.panel-toolbar-extra > span', this.wrap);
+ placeholder.replaceWith(extra_buttons);
// connect group-switch buttons
var group_buttons = $('*.toolbar-tabs-container button', toolbar);
});
// connect action buttons
- var allbuttons = $.makeArray(action_buttons);
+ var allbuttons = $.makeArray(extra_buttons);
$.merge(allbuttons,
$.makeArray($('*.toolbar-button-groups-container button', toolbar)) );
if(event.ctrlKey) code = code | 0x200;
if(event.shiftKey) code = code | 0x400;
- if(this.hotkeys[code] !== null) {
+ $.log(event.character, this.hotkeys[code]);
+
+ if(this.hotkeys[code]) {
return true;
}
return false;
this.fileOptions = this.options;
var self = this;
+
+ if(!this.options.recentFiles)
+ this.options.recentFiles = [];
+
$.each(this.options.recentFiles, function(index) {
if (fileId == self.options.recentFiles[index].fileId) {
$.log('Found options for', fileId);
if(self.autosaveTimer) {
clearTimeout(self.autosaveTimer);
}
- if (data.warnings === null) {
+ if (data.warnings === null || data.warning === undefined) {
self.showPopup('save-successful');
} else {
self.showPopup('save-warn', data.warnings[0]);