add static files
This commit is contained in:
parent
2de5a8030e
commit
70c09da9f8
336 changed files with 82322 additions and 0 deletions
33
static/vendor/select2/tests/dropdown/stopPropagation-tests.js
vendored
Normal file
33
static/vendor/select2/tests/dropdown/stopPropagation-tests.js
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
module('Dropdown - Stoping event propagation');
|
||||
|
||||
var Dropdown = require('select2/dropdown');
|
||||
var StopPropagation = require('select2/dropdown/stopPropagation');
|
||||
|
||||
var $ = require('jquery');
|
||||
var Options = require('select2/options');
|
||||
var Utils = require('select2/utils');
|
||||
|
||||
var CustomDropdown = Utils.Decorate(Dropdown, StopPropagation);
|
||||
|
||||
var options = new Options();
|
||||
|
||||
test('click event does not propagate', function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var $container = $('#qunit-fixture .event-container');
|
||||
var container = new MockContainer();
|
||||
|
||||
var dropdown = new CustomDropdown($('#qunit-fixture select'), options);
|
||||
|
||||
var $dropdown = dropdown.render();
|
||||
dropdown.bind(container, $container);
|
||||
|
||||
$container.append($dropdown);
|
||||
$container.on('click', function () {
|
||||
assert.ok(false, 'The click event should have been stopped');
|
||||
});
|
||||
|
||||
$dropdown.trigger('click');
|
||||
|
||||
assert.ok(true, 'Something went wrong if this failed');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue