diff options
| author | Misko Hevery | 2010-10-26 15:35:58 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-10-26 16:33:59 -0700 |
| commit | 9c0225512c63ebfc37e6408cc155d9da1fe682c9 (patch) | |
| tree | 4973f6c57b801c71cbc93d7d993887ff6d3f9558 /src | |
| parent | 40d7e66f408eaaa66efd8d7934ab2eb3324236a1 (diff) | |
| download | angular.js-9c0225512c63ebfc37e6408cc155d9da1fe682c9.tar.bz2 | |
fixes IE related failures, and form submit event handling in ie
Diffstat (limited to 'src')
| -rw-r--r-- | src/scenario/Scenario.js | 9 | ||||
| -rw-r--r-- | src/scenario/output/Xml.js | 36 | ||||
| -rw-r--r-- | src/widgets.js | 4 |
3 files changed, 28 insertions, 21 deletions
diff --git a/src/scenario/Scenario.js b/src/scenario/Scenario.js index f2ebc640..14d530ac 100644 --- a/src/scenario/Scenario.js +++ b/src/scenario/Scenario.js @@ -246,6 +246,15 @@ function browserTrigger(element, type) { break; } element.fireEvent('on' + type); + if (lowercase(element.type) == 'submit') { + while(element) { + if (lowercase(element.nodeName) == 'form') { + element.fireEvent('onsubmit'); + break; + } + element = element.parentNode; + } + } } else { var evnt = document.createEvent('MouseEvents'); evnt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element); diff --git a/src/scenario/output/Xml.js b/src/scenario/output/Xml.js index 47d98c78..cbc55ee7 100644 --- a/src/scenario/output/Xml.js +++ b/src/scenario/output/Xml.js @@ -3,10 +3,11 @@ */ angular.scenario.output('xml', function(context, runner) { var model = new angular.scenario.ObjectModel(runner); - + var $ = function(args) {return new context.init(args);}; runner.on('RunnerEnd', function() { - context.append('<scenario></scenario>'); - serializeXml(context.find('> scenario'), model.value); + var scenario = $('<scenario></scenario>'); + context.append(scenario); + serializeXml(scenario, model.value); }); /** @@ -17,30 +18,31 @@ angular.scenario.output('xml', function(context, runner) { */ function serializeXml(context, tree) { angular.foreach(tree.children, function(child) { - context.append('<describe></describe>'); - var describeContext = context.find('> describe:last'); + var describeContext = $('<describe></describe>'); describeContext.attr('id', child.id); describeContext.attr('name', child.name); + context.append(describeContext); serializeXml(describeContext, child); }); - context.append('<its></its>'); - context = context.find('> its'); + var its = $('<its></its>'); + context.append(its); angular.foreach(tree.specs, function(spec) { - context.append('<it></it>') - var specContext = context.find('> it:last'); - specContext.attr('id', spec.id); - specContext.attr('name', spec.name); - specContext.attr('duration', spec.duration); - specContext.attr('status', spec.status); + var it = $('<it></it>'); + it.attr('id', spec.id); + it.attr('name', spec.name); + it.attr('duration', spec.duration); + it.attr('status', spec.status); + its.append(it); angular.foreach(spec.steps, function(step) { - specContext.append('<step></step>'); - var stepContext = specContext.find('> step:last'); + var stepContext = $('<step></step>'); stepContext.attr('name', step.name); stepContext.attr('duration', step.duration); stepContext.attr('status', step.status); + it.append(stepContext); if (step.error) { - stepContext.append('<error></error'); - stepContext.find('error').text(formatException(step.error)); + var error = $('<error></error'); + stepContext.append(error); + error.text(formatException(stepContext.error)); } }); }); diff --git a/src/widgets.js b/src/widgets.js index 34cc258a..4d8c71d5 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -203,10 +203,6 @@ function inputWidget(events, modelAccessor, viewAccessor, initFn) { lastValue = model.get(); scope.$tryEval(action, element); scope.$root.$eval(); - // if we have noop initFn than we are just a button, - // therefore we want to prevent default action - if(initFn == noop) - event.preventDefault(); }); } function updateView(){ |
