code_manager.js
4 years ago
code_manager_dashboard.js
4 years ago
code_manager_listmode.js
4 years ago
code_manager_tabmode.js
4 years ago
notify.min.js
4 years ago
code_manager_dashboard.js
81 lines
| 1 | function showMenu() { |
| 2 | if (jQuery("#wpcontent").width()<690) { |
| 3 | jQuery("#cm-dashboard").hide(); |
| 4 | jQuery("#cm-dashboard-mobile").fadeIn(400); |
| 5 | } else { |
| 6 | if (jQuery("#wpcontent").width()<800) { |
| 7 | wd = 46; |
| 8 | fs = 24; |
| 9 | tx = 7; |
| 10 | } else if (jQuery("#wpcontent").width()<860) { |
| 11 | wd = 54; |
| 12 | fs = 30; |
| 13 | tx = 8; |
| 14 | } else { |
| 15 | wd = 62; |
| 16 | fs = 32; |
| 17 | tx = 9; |
| 18 | } |
| 19 | |
| 20 | jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group-code").css("width", |
| 21 | (wd*jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group-code .cm-dashboard-item").length) + "px"); |
| 22 | |
| 23 | jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group-settings").css("width", |
| 24 | (wd*jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group-settings .cm-dashboard-item").length) + "px"); |
| 25 | |
| 26 | jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group-support").css("width", |
| 27 | (wd*jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group-support .cm-dashboard-item").length) + "px"); |
| 28 | |
| 29 | jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group .cm-dashboard-item").css("width", wd + "px"); |
| 30 | jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group .cm-dashboard-item .label").css("font-size", tx + "px"); |
| 31 | jQuery("#cm-dashboard .cm-dashboard .cm-dashboard-group .cm-dashboard-item .material-icons").css("font-size", fs + "px"); |
| 32 | |
| 33 | jQuery("#cm-dashboard-mobile").hide(); |
| 34 | jQuery("#cm-dashboard").fadeIn(400); |
| 35 | |
| 36 | jQuery(".cm_tooltip").tooltip({ |
| 37 | tooltipClass: "cm_tooltip_css", |
| 38 | }); |
| 39 | jQuery(".cm_tooltip_icons").tooltip({ |
| 40 | tooltipClass: "cm_tooltip_icons_css", |
| 41 | position: { |
| 42 | my: "center bottom-18", |
| 43 | at: "center top", |
| 44 | using: function (position, feedback) { |
| 45 | jQuery(this).css(position); |
| 46 | jQuery("<div>") |
| 47 | .addClass("arrow") |
| 48 | .addClass(feedback.vertical) |
| 49 | .addClass(feedback.horizontal) |
| 50 | .appendTo(this); |
| 51 | } |
| 52 | } |
| 53 | }); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | function toggleMenu() { |
| 58 | if (jQuery("#cm-dashboard-mobile ul").is(":visible")) { |
| 59 | jQuery("#cm-dashboard-mobile ul").hide(); |
| 60 | } else { |
| 61 | jQuery("#cm-dashboard-mobile ul").show(); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | function toggleDashboard() { |
| 66 | if (jQuery("#screen-meta").css("display")==="block") { |
| 67 | jQuery("#cm-dashboard").hide(); |
| 68 | jQuery("#cm-dashboard-mobile").hide(); |
| 69 | } else { |
| 70 | showMenu(); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | jQuery(function() { |
| 75 | jQuery("#show-settings-link").on("click", function() { |
| 76 | setTimeout(function() { toggleDashboard(); }, 500); |
| 77 | }); |
| 78 | |
| 79 | jQuery(window).on("resize", function() { showMenu() }); |
| 80 | showMenu(); |
| 81 | }); |