mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-25 22:41:20 +02:00
Add Manipulator object to add shortcuts for dom manipulations
This commit is contained in:
@@ -100,6 +100,7 @@
|
||||
<script src="../dist/dom/eventHandler.js"></script>
|
||||
<script src="../dist/dom/selectorEngine.js"></script>
|
||||
<script src="../dist/dom/data.js"></script>
|
||||
<script src="../dist/dom/manipulator.js"></script>
|
||||
<script src="../dist/util.js"></script>
|
||||
<script src="../dist/alert.js"></script>
|
||||
<script src="../dist/button.js"></script>
|
||||
|
@@ -14,7 +14,8 @@
|
||||
"Simulator": false,
|
||||
"Toast": false,
|
||||
"EventHandler": false,
|
||||
"Data": false
|
||||
"Data": false,
|
||||
"Manipulator": false
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 5,
|
||||
|
@@ -127,21 +127,21 @@ $(function () {
|
||||
assert.ok($btn1.hasClass('active'), 'btn1 has active class')
|
||||
assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked')
|
||||
assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class')
|
||||
assert.ok(!$btn2.find('input').prop('checked'), 'btn2 is not checked')
|
||||
assert.ok(!Manipulator.isChecked($btn2.find('input')[0]), 'btn2 is not checked')
|
||||
|
||||
EventHandler.trigger($btn2.find('input')[0], 'click')
|
||||
|
||||
assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
|
||||
assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked')
|
||||
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
|
||||
assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
|
||||
assert.ok(Manipulator.isChecked($btn2.find('input')[0]), 'btn2 is checked')
|
||||
|
||||
EventHandler.trigger($btn2.find('input')[0], 'click') // clicking an already checked radio should not un-check it
|
||||
|
||||
assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class')
|
||||
assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked')
|
||||
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
|
||||
assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
|
||||
assert.ok(Manipulator.isChecked($btn2.find('input')[0]), 'btn2 is checked')
|
||||
})
|
||||
|
||||
QUnit.test('should only toggle selectable inputs', function (assert) {
|
||||
|
@@ -46,6 +46,7 @@
|
||||
|
||||
<script src="../../../node_modules/jquery/dist/jquery.slim.min.js"></script>
|
||||
<script src="../../dist/dom/eventHandler.js"></script>
|
||||
<script src="../../dist/dom/manipulator.js"></script>
|
||||
<script src="../../dist/dom/selectorEngine.js"></script>
|
||||
<script src="../../dist/dom/data.js"></script>
|
||||
<script src="../../dist/util.js"></script>
|
||||
|
Reference in New Issue
Block a user