[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 $(function () { 2 3 module("bootstrap-dropdowns") 4 5 test("should be defined on jquery object", function () { 6 ok($(document.body).dropdown, 'dropdown method is defined') 7 }) 8 9 test("should return element", function () { 10 ok($(document.body).dropdown()[0] == document.body, 'document.body returned') 11 }) 12 13 test("should add class open to menu if clicked", function () { 14 var dropdownHTML = '<ul class="tabs">' 15 + '<li class="dropdown">' 16 + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' 17 + '<ul class="dropdown-menu">' 18 + '<li><a href="#">Secondary link</a></li>' 19 + '<li><a href="#">Something else here</a></li>' 20 + '<li class="divider"></li>' 21 + '<li><a href="#">Another link</a></li>' 22 + '</ul>' 23 + '</li>' 24 + '</ul>' 25 , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() 26 27 ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') 28 }) 29 30 test("should remove open class if body clicked", function () { 31 var dropdownHTML = '<ul class="tabs">' 32 + '<li class="dropdown">' 33 + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' 34 + '<ul class="dropdown-menu">' 35 + '<li><a href="#">Secondary link</a></li>' 36 + '<li><a href="#">Something else here</a></li>' 37 + '<li class="divider"></li>' 38 + '<li><a href="#">Another link</a></li>' 39 + '</ul>' 40 + '</li>' 41 + '</ul>' 42 , dropdown = $(dropdownHTML) 43 .appendTo('#qunit-fixture') 44 .find('[data-toggle="dropdown"]') 45 .dropdown() 46 .click() 47 ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') 48 $('body').click() 49 ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class removed') 50 dropdown.remove() 51 }) 52 53 })
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |