diff options
| author | Alon Levy <alon@pobox.com> | 2015-04-02 01:00:47 +0300 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-04-02 01:00:47 +0300 |
| commit | 2ca7795ec594a9fe29de0d6f22160f79af340d7b (patch) | |
| tree | 7daee2c4ed24b8b271bc7fcd9607c399998bc95e /src | |
| parent | 1606347e24d57882cc987e0dd31f59fc659fd596 (diff) | |
client: main: fix usage before initialization of rz_core in case of debug=1
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/main.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/client/main.js b/src/client/main.js index 743e5837..c5a81193 100644 --- a/src/client/main.js +++ b/src/client/main.js @@ -26,15 +26,6 @@ function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop, if (json) { rz_core.load_from_json(json); } - if (util.getParameterByName('debug')) { - $(document.body).addClass('debug'); - rz_core.edit_graph.set_user('fakeuser'); - rz_core.main_graph.set_user('fakeuser'); - drag_n_drop.init(); - } else { - drag_n_drop.prevent_default_drop_behavior(); - } - keyshortcuts.install(); var intro_task_elem = $('#intro-task'); @@ -55,6 +46,17 @@ function(textanalysis_ui, textanalysis, buttons, history, drag_n_drop, selection.setup_toolbar(rz_core.main_graph); $.feedback({ajaxURL: rz_config.feedback_url}); fix_feedback_scrolling_to_visibility_causing_topbar_to_slide_slowly_in_webkit(); + + // setup debug + if (util.getParameterByName('debug')) { + $(document.body).addClass('debug'); + rz_core.edit_graph.set_user('fakeuser'); + rz_core.main_graph.set_user('fakeuser'); + drag_n_drop.init(); + } else { + // drag and drop prevented in normal operation (debug not set) + drag_n_drop.prevent_default_drop_behavior(); + } } return { |
