Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Commit

Permalink
BT-44 - In script.js, removed the plugin_backup object and refere…
Browse files Browse the repository at this point in the history
…nces to it from `admin` since it was throwing JavaScript exceptions in my testing; also changed how we hide the "backup running" section to use `display` instead of `visibility`
  • Loading branch information
tatewake committed Sep 14, 2020
1 parent 5b67e15 commit 6bbe66a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
4 changes: 1 addition & 3 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ protected function runBackup()
$fn = mediaFN($id);
try {
echo '<div class="log">';
echo '<script>plugin_backup.start();</script>';
tpl_flush();
$this->createBackup($fn, $this->loadPreferences(), [$this, 'logXHTML']);
echo '</div>';
Expand All @@ -161,8 +160,7 @@ protected function runBackup()
@unlink($fn);
}

echo '<script>document.getElementsByClassName(\'bt-running\')[0].style.visibility=\'hidden\';</script>';
echo '<script>plugin_backup.stop();</script>';
echo '<script>document.getElementsByClassName(\'bt-running\')[0].style.display=\'none\';</script>';
}

/**
Expand Down
21 changes: 0 additions & 21 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
var plugin_backup = {
timer: null,
$log: null,

start: function() {
plugin_backup.$log = jQuery('.plugin_backup .log');
plugin_backup.timer = window.setInterval(function() {
plugin_backup.$log.scrollTop(plugin_backup.$log[0].scrollHeight);
}, 100);
},

stop: function() {
if (plugin_backup.timer) {
window.clearInterval(plugin_backup.timer);
plugin_backup.timer = null;
}
jQuery('.plugin_backup .running').hide();
plugin_backup.$log.scrollTop(plugin_backup.$log[0].scrollHeight);
}
};

var btColl = document.getElementsByClassName("collapsible");
for (var btIter = 0; btIter < btColl.length; i++) {
btColl[btIter].addEventListener("click", function() {
Expand Down

0 comments on commit 6bbe66a

Please sign in to comment.