Line 4: |
Line 4: |
| | | |
| $(document).ready(function() { | | $(document).ready(function() { |
| + | |
| + | console.log('DetailToggle v1.0.0'); |
| | | |
| // custom hidable content and togglers supported by local storage | | // custom hidable content and togglers supported by local storage |
Line 45: |
Line 47: |
| $(toggle_show_selector).show(); | | $(toggle_show_selector).show(); |
| $(toggle_hide_selector).hide(); | | $(toggle_hide_selector).hide(); |
− | $(target_class).show(); | + | if (property_classes) { |
| + | $(target_class).addClass(property_classes); |
| + | } else { |
| + | $(target_class).show(); |
| + | } |
| if (anti_target_class) { | | if (anti_target_class) { |
| $(anti_target_class).hide(); | | $(anti_target_class).hide(); |
− | }
| |
− | if (property_classes) {
| |
− | $(target_class).addClass(property_classes);
| |
| } | | } |
| } else { | | } else { |
| $(toggle_show_selector).hide(); | | $(toggle_show_selector).hide(); |
| $(toggle_hide_selector).show(); | | $(toggle_hide_selector).show(); |
− | $(target_class).hide(); | + | if (property_classes) { |
| + | $(target_class).removeClass(property_classes); |
| + | } else { |
| + | $(target_class).hide(); |
| + | } |
| if (anti_target_class) { | | if (anti_target_class) { |
| $(anti_target_class).show(); | | $(anti_target_class).show(); |
− | }
| |
− | if (property_classes) {
| |
− | $(target_class).removeClass(property_classes);
| |
| } | | } |
| } | | } |
Line 156: |
Line 160: |
| toggle_element.show(); | | toggle_element.show(); |
| update(toggle_element); | | update(toggle_element); |
| + | if (toggle_element.hasClass('toggle-passive')) { |
| + | return; |
| + | } |
| toggle_element.off("click"); | | toggle_element.off("click"); |
| toggle_element.click(function() { | | toggle_element.click(function() { |