1
0
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:
Johann-S
2017-09-05 14:35:52 +02:00
committed by XhmikosR
parent 44f38e4128
commit 9f9712b98c
7 changed files with 34 additions and 6 deletions

View File

@@ -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>

View File

@@ -14,7 +14,8 @@
"Simulator": false,
"Toast": false,
"EventHandler": false,
"Data": false
"Data": false,
"Manipulator": false
},
"parserOptions": {
"ecmaVersion": 5,

View File

@@ -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) {

View File

@@ -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>