From: Moritz Bunkus Date: Wed, 29 Apr 2015 09:37:02 +0000 (+0200) Subject: ClientJS: DOM-Funktion scrollIntoView() als ClientJS->scroll_into_view implementiert X-Git-Tag: release-3.3.0beta~113 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1b2ef48beb83019b3f4ad6cca23c83b2d2d8cc99;p=kivitendo-erp.git ClientJS: DOM-Funktion scrollIntoView() als ClientJS->scroll_into_view implementiert --- 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]);