diff options
| -rw-r--r-- | jsTestDriver.conf | 4 | ||||
| -rw-r--r-- | src/Angular.js | 4 | ||||
| -rw-r--r-- | src/filters.js | 4 | ||||
| -rw-r--r-- | src/jqLite.js | 4 | ||||
| -rw-r--r-- | src/services.js | 2 | ||||
| -rw-r--r-- | test/testabilityPatch.js | 12 |
6 files changed, 21 insertions, 9 deletions
diff --git a/jsTestDriver.conf b/jsTestDriver.conf index 9c2ef63f..196d282f 100644 --- a/jsTestDriver.conf +++ b/jsTestDriver.conf @@ -3,9 +3,7 @@ server: http://localhost:9876 load: - lib/jasmine/jasmine-0.10.3.js - lib/jasmine-jstd-adapter/JasmineAdapter.js -# - lib/webtoolkit/webtoolkit.base64.js -# - lib/jquery/jquery-1.4.2.js -# - lib/underscore/underscore.js + - lib/jquery/jquery-1.4.2.js - src/Angular.js - src/*.js - src/scenario/_namespace.js diff --git a/src/Angular.js b/src/Angular.js index 11ac7c1c..a4421f0e 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -112,9 +112,7 @@ function lowercase(value){ return isString(value) ? value.toLowerCase() : value; function uppercase(value){ return isString(value) ? value.toUpperCase() : value; } function trim(value) { return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; } function isElement(node) { - if (node && !node.item && isDefined(node.length) && isDefined(node[0])) - node = node[0]; - return node && node.nodeName; + return node && (node.nodeName || node instanceof JQLite || node instanceof jQuery); } if (msie) { diff --git a/src/filters.js b/src/filters.js index d0fc2ae7..74013db1 100644 --- a/src/filters.js +++ b/src/filters.js @@ -269,7 +269,9 @@ foreach({ }, 'html': function(html){ - return jqLite(html); + var div = jqLite('div'); + div.html(html); + return div.children(); }, 'linky': function(text){ diff --git a/src/jqLite.js b/src/jqLite.js index 36248e71..ec1c52d2 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -118,6 +118,10 @@ JQLite.prototype = { this[0].parentNode.replaceChild(jqLite(replaceNode)[0], this[0]); }, + children: function() { + return new JQLite(this[0].childNodes); + }, + append: function(node) { var self = this[0]; node = jqLite(node); diff --git a/src/services.js b/src/services.js index d98c0876..d6c3ad8a 100644 --- a/src/services.js +++ b/src/services.js @@ -103,7 +103,7 @@ angularService("$hover", function(browser) { width: width + "px" }); } - } else if (tooltip) { + } else if (tooltip && false) { tooltip.callout.remove(); tooltip = null; } diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index a2d67923..e5eef63e 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -1,7 +1,11 @@ jstd = jstestdriver; dump = bind(jstd.console, jstd.console.log); -var NBSP = jqLite(' ').text(); +var NBSP = (function(){ + var div = document.createElement('div'); + div.innerHtml = ' '; + return msie ? div.innerText : div.textContent; +})(); function nakedExpect(obj) { return expect(angular.fromJson(angular.toJson(obj))); @@ -82,6 +86,12 @@ function sortedHtml(element) { } } style.sort(); + var tmp = style; + style = []; + foreach(tmp, function(value){ + if (!value.match(/^max[^\-]/)) + style.push(value); + }); if (style.length) { html += ' style="' + style.join('; ') + ';"'; } |
