diff options
author | Dirk Brenken <dev@brenken.org> | 2020-04-06 14:41:36 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2020-04-06 14:41:36 +0200 |
commit | 0f8aea76e0d1597cf3f53664941e157cdeb631ed (patch) | |
tree | 4df1cd0b1669fc43c2a6396456d09c2a8eec71e0 /applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js | |
parent | 65fb44da9fb8435c7958455bb4b00354bff6cb00 (diff) |
luci-app-adblock: revert poll/view class changes
* this partly reverts 3c4bc22 to ensure 19.07.2 compatibility,
this is only a temporary "fix" as long as we don't have
adblock 4 backported to 19.07 branch
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js')
-rw-r--r-- | applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js index 5d4eca53a6..4c20c48ec3 100644 --- a/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js +++ b/applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js @@ -1,6 +1,4 @@ 'use strict'; -'require view'; -'require poll'; 'require fs'; 'require ui'; 'require uci'; @@ -100,7 +98,7 @@ async function handleAction(ev) { } } - poll.start(); + L.Poll.start(); fs.exec_direct('/etc/init.d/adblock', [ev]) var running = 1; while (running === 1) { @@ -111,10 +109,10 @@ async function handleAction(ev) { } }) } - poll.stop(); + L.Poll.stop(); } -return view.extend({ +return L.view.extend({ load: function() { return Promise.all([ L.resolveDefault(fs.exec_direct('/etc/init.d/adblock', ['list']), {}), @@ -131,7 +129,7 @@ return view.extend({ /* poll runtime information */ - pollData: poll.add(function() { + pollData: L.Poll.add(function() { return L.resolveDefault(fs.read_direct('/tmp/adb_runtime.json'), 'null').then(function(res) { var info = JSON.parse(res); var status = document.getElementById('status'); @@ -144,7 +142,7 @@ return view.extend({ } else { if (status.classList.contains("spinning")) { status.classList.remove("spinning"); - poll.stop(); + L.Poll.stop(); } } if (status.textContent.substr(0,6) === 'paused' && document.getElementById('btn_suspend')) { |