Index: trunk/extensions/MobileFrontend/tests/js/test_toggle.js |
— | — | @@ -37,13 +37,10 @@ |
38 | 38 | strictEqual($("#section_1 .show").is(":visible"), true, "check show button now visible"); |
39 | 39 | }); |
40 | 40 | |
41 | | -test("wm_reveal_for_hash", function() { |
| 41 | +test("clicking a hash link to reveal an already open section", function() { |
| 42 | + strictEqual($("#section_1").hasClass("openSection"), true, "check section is open"); |
42 | 43 | MFE.toggle.wm_reveal_for_hash("#First_Section"); |
43 | | - applyCss(); |
44 | | - strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle"); |
45 | | - strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle"); |
46 | | - strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible"); |
47 | | - strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden"); |
| 44 | + strictEqual($("#section_1").hasClass("openSection"), true, "check section is still open"); |
48 | 45 | }); |
49 | 46 | |
50 | 47 | test("wm_reveal_for_hash", function() { |
Index: trunk/extensions/MobileFrontend/javascripts/toggle.js |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | !u(p).hasClass( 'section_heading' ) ) { |
64 | 64 | p = p.parentNode; |
65 | 65 | } |
66 | | - if ( p && p.style.display !== 'block' ) { |
| 66 | + if ( p && ! u( p ).hasClass( 'openSection' ) ) { |
67 | 67 | section_idx = parseInt( p.id.split( '_' )[1], 10 ); |
68 | 68 | wm_toggle_section( section_idx ); |
69 | 69 | } |