class PropertiesPerspective extends $.wiki.SidebarPerspective {
vsplitbar = 'WŁAŚCIWOŚCI';
+ $edited = null;
constructor(options) {
super(options);
} else {
$input.data("edited").text(inputval);
}
+ $.wiki.perspectives.VisualPerspective.flush();
return;
}
let htmlElem = $(html);
self.$edited.replaceWith(htmlElem);
self.edit(htmlElem);
+ $.wiki.activePerspective().flush();
}
});
},
self.$pane.on('click', '.meta-delete', function() {
let $fg = $(this).closest('.form-group');
- $('input', $fg).data('edited').remove();
+ let $ig = $(this).closest('.input-group');
+ $('input', $ig).data('edited').remove();
self.displayMetaProperty($fg);
+ $.wiki.perspectives.VisualPerspective.flush();
return false;
});
if (element === null) {
self.$edited = null;
+ $("h1", self.$pane).text('');
return;
}
if ($.wiki.activePerspective() != 'VisualPerspective')
$.wiki.switchToTab('#VisualPerspective');
- if (self.$edited === null) {
- self.edit($('[x-node="utwor"]')[0]);
+ this.enable();
+ }
+
+ enable() {
+ if (this.$edited === null) {
+ this.edit($('[x-node="utwor"]')[0]);
}
}
+ disable() {
+ this.edit(null);
+ }
}
$.wiki.PropertiesPerspective = PropertiesPerspective;