diff options
author | MrYamous <matt.lempereur@gmail.com> | 2019-10-09 06:45:33 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2019-10-09 06:45:33 +0300 |
commit | e5b034d46ff3a793837944c4f6445c694007ce5f (patch) | |
tree | dd503e47a2d20f5d5f138fa51d2d7fc7baeaa07f /plugins/CorePluginsAdmin/templates | |
parent | 76fc24379eac635d05b6e04c81ed2afc59f81b08 (diff) |
Don't allow update 0 plugin (#14811)
* Don't allow update 0 plugin
* Use anonymous function to don't allow update 0 plugin
* Remove onclick()
* Update selector
Diffstat (limited to 'plugins/CorePluginsAdmin/templates')
-rw-r--r-- | plugins/CorePluginsAdmin/templates/macros.twig | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/CorePluginsAdmin/templates/macros.twig b/plugins/CorePluginsAdmin/templates/macros.twig index 9c753c77d6..d5cb16bdff 100644 --- a/plugins/CorePluginsAdmin/templates/macros.twig +++ b/plugins/CorePluginsAdmin/templates/macros.twig @@ -3,14 +3,14 @@ {% import '@Marketplace/macros.twig' as marketplaceMacro %} <div> - <a id="update-selected-plugins" href="javascript:" class="btn">{{ 'CorePluginsAdmin_UpdateSelected'|translate }}</a> + <a id="update-selected-plugins" href="javascript:" class="btn disabled">{{ 'CorePluginsAdmin_UpdateSelected'|translate }}</a> </div> <table piwik-content-table> <thead> <tr> <th> <span class="checkbox-container"> - <input type="checkbox" id="select-plugin-all" /> + <input type="checkbox" id="select-plugin-all"/> <label for="select-plugin-all"></label> </span> </th> @@ -74,6 +74,11 @@ <script> $(function () { + $('span.checkbox-container').on('change', function() { + var isAtLeastOneChecked = $('span.checkbox-container > input:checked').length >= 1; + isAtLeastOneChecked ? $('#update-selected-plugins').removeClass('disabled') : $('#update-selected-plugins').addClass('disabled'); + }); + $('#update-selected-plugins').on('click', function () { var pluginsToUpdate = []; $('tbody#plugins td.select-cell input').each(function () { |