From 1b2ef48beb83019b3f4ad6cca23c83b2d2d8cc99 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 29 Apr 2015 11:37:02 +0200 Subject: [PATCH] ClientJS: DOM-Funktion scrollIntoView() als ClientJS->scroll_into_view implementiert --- SL/ClientJS.pm | 2 ++ js/client_js.js | 1 + 2 files changed, 3 insertions(+) diff --git a/SL/ClientJS.pm b/SL/ClientJS.pm index 2eedbee07..d4775b830 100644 --- a/SL/ClientJS.pm +++ b/SL/ClientJS.pm @@ -118,6 +118,8 @@ my %supported_methods = ( reinit_widgets => 0, # kivi.reinit_widgets() run => -1, # kivi.run(, ) run_once_for => 3, # kivi.run_once_for(, ) + + scroll_into_view => 1, # $()[0].scrollIntoView() ); sub AUTOLOAD { diff --git a/js/client_js.js b/js/client_js.js index a0e6eab61..6d8981990 100644 --- a/js/client_js.js +++ b/js/client_js.js @@ -131,6 +131,7 @@ ns.eval_json_result = function(data) { else if (action[0] == 'reinit_widgets') kivi.reinit_widgets(); else if (action[0] == 'run') kivi.run(action[1], action.slice(2, action.length)); else if (action[0] == 'run_once_for') kivi.run_once_for(action[1], action[2], action[3]); + else if (action[0] == 'scroll_into_view') $(action[1])[0].scrollIntoView(); else console.log('Unknown action: ' + action[0]); -- 2.20.1