PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.3
Responsive Menu – Create Mobile-Friendly Menu v3.0.3
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / src / public / js / admin / main.js

main.js in Responsive Menu – Create Mobile-Friendly Menu 3.0.3, at src/public/js/admin/main.js

60 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery(function($) {
2
3 $('.wp-color-picker').wpColorPicker();
4
5 var custom_uploader;
6
7 $('.image_button').click(function (e) {
8 e.preventDefault();
9 window.imgFor = $(this).attr('for');
10 //If the uploader object has already been created, reopen the dialog
11 if (custom_uploader) {
12 custom_uploader.open();
13 return;
14 }
15 //Extend the wp.media object
16 custom_uploader = wp.media.frames.file_frame = wp.media({
17 title: 'Choose Image',
18 button: {
19 text: 'Choose Image',
20 id: 'test'
21 },
22 multiple: false
23 });
24
25 //When a file is selected, grab the URL and set it as the text field's value
26 custom_uploader.on('select', function () {
27 attachment = custom_uploader.state().get('selection').first().toJSON();
28 $('#' + window.imgFor).val(attachment.url);
29 });
30
31 //Open the uploader dialog
32 custom_uploader.open();
33 });
34
35 $(document).on('click', '.tab', function() {
36 container_name = '#tab_container_' + $(this).attr('id').replace('tab_', '');
37 $('.tab_container').css('display', 'none');
38 $(container_name).css('display', 'block');
39 $('.tab').removeClass('active_tab');
40 $(this).addClass('active_tab');
41 if(typeof(Storage) !== "undefined") {
42 localStorage.responsive_menu_tab = $(this).attr('id');
43 }
44 });
45
46 if(typeof(Storage) !== "undefined") {
47 if(localStorage.rmupgrade) {
48 $('.upgrade-notes').hide();
49 } else {
50 $(document).on('click', '.upgrade-notes-close', function(e) {
51 e.stopPropagation();
52 e.preventDefault();
53 $('.upgrade-notes').fadeOut();
54 localStorage.rmupgrade = "true";
55 });
56 }
57 }
58
59 });
60