custom.js
2 years ago
jquery.timepicker.min.js
2 years ago
pi-order-page.js
2 years ago
pi-woocommerce-order-date-time-and-type-pro-admin.js
2 years ago
pisol-quick-save.js
2 years ago
pisol-quick-save.js
47 lines
| 1 | /** |
| 2 | * v1.0.2 |
| 3 | */ |
| 4 | (function ($) { |
| 5 | 'use strict'; |
| 6 | |
| 7 | /** |
| 8 | * Add class exclude-quick-save to the form you want to exclude from quick save |
| 9 | */ |
| 10 | function quickSaveButton() { |
| 11 | this.init = function () { |
| 12 | this.form = jQuery('form[action="options.php"]').not('.exclude-quick-save'); |
| 13 | this.addButton(); |
| 14 | this.onClick(); |
| 15 | } |
| 16 | |
| 17 | this.addButton = function () { |
| 18 | if (this.form.length == 1) { |
| 19 | var button = jQuery('<button type="submit" id="pisol-quick-save" class="btn btn-danger btn-lg">Save Changes</button>').css({ |
| 20 | 'position': 'fixed', |
| 21 | 'top': '50%', |
| 22 | 'right': '-75px', |
| 23 | 'z-index': '100000000000', |
| 24 | 'transform': 'rotate(-90deg)', |
| 25 | 'border-color': '#FFFFFF', |
| 26 | 'width': '190px' |
| 27 | }); |
| 28 | this.form.append(button); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | this.onClick = function () { |
| 33 | var parent = this; |
| 34 | jQuery(document).on('click', '#pisol-quick-save', function (e) { |
| 35 | parent.form.trigger('submit'); |
| 36 | jQuery(this).text('Saving....'); |
| 37 | }); |
| 38 | } |
| 39 | |
| 40 | } |
| 41 | |
| 42 | jQuery(function ($) { |
| 43 | var quickSaveButtonObj = new quickSaveButton(); |
| 44 | quickSaveButtonObj.init(); |
| 45 | }); |
| 46 | |
| 47 | })(jQuery); |