Skip to content

Commit 47ce225

Browse files
authored
Merge pull request #359 from rottaran/ticket_351_fastwiki
fixes #351 based on zioth's suggestion
2 parents fd85dc6 + 39e8808 commit 47ce225

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

script.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
jQuery(function () {
1+
jQuery(function() {
22
/* DOKUWIKI:include script/functions.js */
3-
43
/* DOKUWIKI:include script/EntryEditor.js */
5-
EntryEditor(jQuery('#dw__editform, form.bureaucracy__plugin'));
6-
74
/* DOKUWIKI:include script/SchemaEditor.js */
8-
SchemaEditor();
9-
105
/* DOKUWIKI:include script/LookupEditor.js */
11-
jQuery('div.structlookup table').each(LookupEditor);
12-
136
/* DOKUWIKI:include script/InlineEditor.js */
14-
InlineEditor(jQuery('div.structaggregation table'));
7+
8+
function init() {
9+
EntryEditor(jQuery('#dw__editform, form.bureaucracy__plugin'));
10+
SchemaEditor();
11+
jQuery('div.structlookup table').each(LookupEditor);
12+
InlineEditor(jQuery('div.structaggregation table'));
13+
}
14+
15+
jQuery(init);
16+
17+
jQuery(window).on('fastwiki:afterSwitch', function(evt, viewMode, isSectionEdit, prevViewMode) {
18+
if (viewMode=="edit" || isSectionEdit) {
19+
EntryEditor(jQuery('#dw__editform, form.bureaucracy__plugin'));
20+
}
21+
});
1522
});

0 commit comments

Comments
 (0)