admin-post.js
11 years ago
admin-settings.js
11 years ago
admin.js
12 years ago
frontend.js
11 years ago
admin-post.js
49 lines
| 1 | (function ($) { |
| 2 | |
| 3 | $(document).ready(function () { |
| 4 | |
| 5 | // post views input |
| 6 | $('#post-views .edit-post-views').click(function () { |
| 7 | if ($('#post-views-input-container').is(":hidden")) { |
| 8 | $('#post-views-input-container').slideDown('fast'); |
| 9 | $(this).hide(); |
| 10 | } |
| 11 | return false; |
| 12 | }); |
| 13 | |
| 14 | // save post views |
| 15 | $('#post-views .save-post-views').click(function () { |
| 16 | |
| 17 | var views = $.trim($('#post-views-display b').text()); |
| 18 | |
| 19 | $('#post-views-input-container').slideUp('fast'); |
| 20 | $('#post-views .edit-post-views').show(); |
| 21 | |
| 22 | views = parseInt($('#post-views-input').val()); |
| 23 | // reassign value as integer |
| 24 | $('#post-views-input').val(views); |
| 25 | |
| 26 | $('#post-views-display b').text(views); |
| 27 | |
| 28 | return false; |
| 29 | }); |
| 30 | |
| 31 | // cancel post views |
| 32 | $('#post-views .cancel-post-views').click(function () { |
| 33 | |
| 34 | var views = $.trim($('#post-views-display b').text()); |
| 35 | |
| 36 | $('#post-views-input-container').slideUp('fast'); |
| 37 | $('#post-views .edit-post-views').show(); |
| 38 | |
| 39 | views = parseInt($('#post-views-current').val()); |
| 40 | |
| 41 | $('#post-views-display b').text(views); |
| 42 | $('#post-views-input').val(views); |
| 43 | |
| 44 | return false; |
| 45 | }); |
| 46 | |
| 47 | }); |
| 48 | |
| 49 | })(jQuery); |