fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Undo
[redakcja.git]
/
src
/
redakcja
/
static
/
js
/
wiki
/
view_properties.js
diff --git
a/src/redakcja/static/js/wiki/view_properties.js
b/src/redakcja/static/js/wiki/view_properties.js
index
35d0069
..
a3fe432
100644
(file)
--- a/
src/redakcja/static/js/wiki/view_properties.js
+++ b/
src/redakcja/static/js/wiki/view_properties.js
@@
-39,13
+39,13
@@
};
class PropertiesPerspective extends $.wiki.SidebarPerspective {
};
class PropertiesPerspective extends $.wiki.SidebarPerspective {
- constructor(options) {
-
let oldCallback = options.callback || function() {}
;
+ vsplitbar = 'WŁAŚCIWOŚCI';
+
$edited = null
;
- options.callback = function() {
+ constructor(options) {
+ super(options);
let self = this;
let self = this;
- self.vsplitbar = 'WŁAŚCIWOŚCI';
self.$pane = $("#side-properties");
$("#simple-editor").on('click', '[x-node]', function(e) {
self.$pane = $("#side-properties");
$("#simple-editor").on('click', '[x-node]', function(e) {
@@
-79,6
+79,7
@@
} else {
$input.data("edited").text(inputval);
}
} else {
$input.data("edited").text(inputval);
}
+ $.wiki.perspectives.VisualPerspective.flush();
return;
}
return;
}
@@
-100,6
+101,7
@@
let htmlElem = $(html);
self.$edited.replaceWith(htmlElem);
self.edit(htmlElem);
let htmlElem = $(html);
self.$edited.replaceWith(htmlElem);
self.edit(htmlElem);
+ $.wiki.activePerspective().flush();
}
});
},
}
});
},
@@
-149,6
+151,7
@@
let $fg = $(this).closest('.form-group');
$('input', $fg).data('edited').remove();
self.displayMetaProperty($fg);
let $fg = $(this).closest('.form-group');
$('input', $fg).data('edited').remove();
self.displayMetaProperty($fg);
+ $.wiki.perspectives.VisualPerspective.flush();
return false;
});
return false;
});
@@
-180,11
+183,6
@@
self.$pane.on('click', '#current-delete', function() {
self.delete();
});
self.$pane.on('click', '#current-delete', function() {
self.delete();
});
-
- oldCallback.call(this);
- };
-
- super(options);
}
edit(element) {
}
edit(element) {
@@
-198,6
+196,7
@@
if (element === null) {
self.$edited = null;
if (element === null) {
self.$edited = null;
+ $("h1", self.$pane).text('');
return;
}
return;
}
@@
-407,10
+406,17
@@
if ($.wiki.activePerspective() != 'VisualPerspective')
$.wiki.switchToTab('#VisualPerspective');
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;
}
$.wiki.PropertiesPerspective = PropertiesPerspective;