diff options
| author | Pedro Del Gallego | 2012-08-29 15:39:34 +0200 |
|---|---|---|
| committer | Misko Hevery | 2012-09-06 16:06:24 -0700 |
| commit | 8cb9c99ec064fd95567118d29bfa4a19b8613ab3 (patch) | |
| tree | fafdbbe4de34497e5771265469af301f8570f96a /src/ngScenario | |
| parent | 9473780e77a960ba27644ca76c2413924cc8972e (diff) | |
| download | angular.js-8cb9c99ec064fd95567118d29bfa4a19b8613ab3.tar.bz2 | |
feat(scenario): add dblclick method to the ngScenario dsl
Diffstat (limited to 'src/ngScenario')
| -rw-r--r-- | src/ngScenario/dsl.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ngScenario/dsl.js b/src/ngScenario/dsl.js index 7939735d..f660c318 100644 --- a/src/ngScenario/dsl.js +++ b/src/ngScenario/dsl.js @@ -365,6 +365,22 @@ angular.scenario.dsl('element', function() { }); }; + chain.dblclick = function() { + return this.addFutureAction("element '" + this.label + "' dblclick", function($window, $document, done) { + var elements = $document.elements(); + var href = elements.attr('href'); + var eventProcessDefault = elements.trigger('dblclick')[0]; + + if (href && elements[0].nodeName.toUpperCase() === 'A' && eventProcessDefault) { + this.application.navigateTo(href, function() { + done(); + }, done); + } else { + done(); + } + }); + }; + chain.query = function(fn) { return this.addFutureAction('element ' + this.label + ' custom query', function($window, $document, done) { fn.call(this, $document.elements(), done); |
