Skip to content

Commit

Permalink
controller: Add config.search_jump_mode, to make search results use f…
Browse files Browse the repository at this point in the history
…lights #91
  • Loading branch information
lentinj committed Jun 20, 2018
1 parent 66635b8 commit 97fe44b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,15 @@ export default function (Controller) {

/**
* Jump to OZid and record URL of the new location
* config.search_jump_mode controls how the movement is performed
* @param src the OZid of the place we want to jump to
*/
Controller.prototype.jump_to_OZid = function(OZid) {
this.perform_leap_animation(OZid);
if (config.search_jump_mode === 'flight') {
this.perform_flight_transition(null, OZid);
} else {
this.perform_leap_animation(OZid);
}
record_url();
}

Expand Down
4 changes: 4 additions & 0 deletions OZprivate/rawJS/OZTreeModule/src/global_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ config.generation_on_subbranch_during_fly = 7;
/** @property {number} generation_at_searched_node - generation to develop on the searched node if the searched node is an interior node.
*/
config.generation_at_searched_node = 9;

/** @property {string} search_jump_mode - How to move to a new node: "flight" or "leap"
*/
config.search_jump_mode = "leap";

config.api = {
/* These configure how API calls are made, and to where.
Expand Down
2 changes: 1 addition & 1 deletion views/treeviewer/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@
window.polytomy_cut_position_map_json_str,
window.cut_threshold,
window.tree_date);
{{=";\n".join(setup_params.get('pre_ui_setup', []))}}
{{response.write(";\n".join(setup_params.get('pre_ui_setup', [])), escape=False)}}
setupUI();
})

Expand Down
1 change: 1 addition & 0 deletions views/treeviewer/otop.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
']'
),
'pre_ui_setup': [
'onezoom.config.search_jump_mode = "flight"',
'onezoom.config.projection.draw_sponsors = false',
'onezoom.config.projection.sign_thres = 170'
]
Expand Down

0 comments on commit 97fe44b

Please sign in to comment.