diff options
author | root | 2019-02-19 18:53:50 +0100 |
---|---|---|
committer | root | 2019-02-19 18:53:50 +0100 |
commit | 0ad4c0f8196b61699754762aacbaab0223478ab9 (patch) | |
tree | de434c4aea8d07ecd01cd3badd48d057d62c2d1b /script | |
parent | [usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff) | |
parent | [statistics] Fix RAM change warning to handle increase too (diff) | |
download | slx-admin-usb-lock-off.tar.gz slx-admin-usb-lock-off.tar.xz slx-admin-usb-lock-off.zip |
Merge branch 'master' into usb-lock-offusb-lock-off
Diffstat (limited to 'script')
-rw-r--r-- | script/slx-fixes.js | 19 | ||||
-rw-r--r-- | script/taskmanager.js | 11 |
2 files changed, 23 insertions, 7 deletions
diff --git a/script/slx-fixes.js b/script/slx-fixes.js index 12db9c79..a5864efb 100644 --- a/script/slx-fixes.js +++ b/script/slx-fixes.js @@ -1,6 +1,8 @@ // Give file select dialogs a modern style and feel $(document).on('change', '.btn-file :file', function() { var input = $(this); + if (input.parents('.disabled').length !== 0) + return; var numFiles = input.get(0).files ? input.get(0).files.length : 1; var label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.trigger('fileselect', [numFiles, label]); @@ -15,23 +17,23 @@ $(document).ready(function() { }); }); $('.upload-ex :text').click(function () { - $(this).parents('.upload-ex').find(':file').click(); + var $this = $(this); + if ($this.parents('.disabled').length !== 0) + return; + $this.parents('.upload-ex').find(':file').click(); }); // Replace message query params in URL, so you won't see them again if you bookmark or share the link if (history && history.replaceState && window && window.location && window.location.search && window.location.search.indexOf('message[]=') !== -1) { var str = window.location.search; - console.log('TRUE: ' + str); do { var repl = str.match(/([\?&])message\[\]=[^&]+(&|$)/); - console.log(repl); if (!repl) break; if (repl[2].length === 0) { str = str.replace(repl[0], ''); } else { str = str.replace(repl[0], repl[1]); } - console.log('Replace: ' + str); } while (1); history.replaceState(null, null, window.location.pathname + str); } @@ -39,4 +41,13 @@ if (history && history.replaceState && window && window.location && window.locat // Simple decollapse functionality for tables $('.slx-decollapse').click(function () { $(this).siblings('.collapse').removeClass('collapse'); +}); + +// Show not-allowed cursor for disabled links (not in btn-group as it messes up the style) +$('a.disabled').each(function() { + var $this = $(this); + if ($this.parent().hasClass('btn-group')) return; + var $hax = $('<div class="disabled-hack">'); + $this.after($hax); + $hax.append($this); });
\ No newline at end of file diff --git a/script/taskmanager.js b/script/taskmanager.js index 5eae6cb3..ae1d2f09 100644 --- a/script/taskmanager.js +++ b/script/taskmanager.js @@ -16,7 +16,13 @@ function tmInit() item.append('<div class="data-tm-progress"><div class="progress"><div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div></div></div>'); } if (item.is('[data-tm-log]')) { - item.append('<pre class="data-tm-log" style="display:none" />'); + var lh = item.data('tm-log-height'); + if (!lh) { + lh = ''; + } else { + lh = 'min-height:' + lh; + } + item.append('<pre class="data-tm-log collapse" style="' + lh + '" />'); } item.prepend('<span class="data-tm-icon" />'); }); @@ -123,8 +129,7 @@ function tmResult(data, status) if (log) { var lKey = obj.attr('data-tm-log'); if (task.data && task.data[lKey]) { - log.text(task.data[lKey]); - log.attr('style', (task.data[lKey] !== '' ? '' : 'display:none')); + log.text(task.data[lKey]).show(); } } var cb = obj.attr('data-tm-callback'); |