Permalink
Browse files

Update Knockback to 0.16.7 and added pane navigator polling for DOM c…

…hanges
  • Loading branch information...
1 parent 8f0a436 commit 950d7fd9c11f76a2536533e9510ba97caf41cd0e Kevin Malakoff committed Sep 21, 2012
Showing with 252 additions and 204 deletions.
  1. +4 −0 RELEASE_NOTES.md
  2. +1 −1 examples/pnp-nt-i_xui_pth_kb.html
  3. +1 −1 examples/pnp-t-e_jq_kb.html
  4. +1 −1 examples/pnp-t-i_jq_kb.html
  5. +1 −1 examples/pnp-t_jq_kb.html
  6. +1 −1 examples/pnp-t_zpt_kb.html
  7. +1 −1 examples/pns-e_jq_kb.html
  8. +1 −1 examples/pns-i_zpt_kb.html
  9. +1 −1 examples/pns_jq_kb.html
  10. +1 −1 examples/pns_zpt_kb.html
  11. +4 −4 examples/vendor/{knockback-core-stack-0.16.6.js → knockback-core-stack-0.16.7.js}
  12. +31 −25 knockback-page-navigator-panes.js
  13. +1 −1 knockback-page-navigator-panes.min.js
  14. +1 −4 knockback-page-navigator-simple.js
  15. +1 −1 knockback-page-navigator-simple.min.js
  16. +30 −21 knockback-pane-navigator.js
  17. +1 −1 knockback-pane-navigator.min.js
  18. +2 −2 package.json
  19. +31 −25 packages/npm/knockback-page-navigator-panes.js
  20. +1 −1 packages/npm/knockback-page-navigator-panes.min.js
  21. +1 −4 packages/npm/knockback-page-navigator-simple.js
  22. +1 −1 packages/npm/knockback-page-navigator-simple.min.js
  23. +30 −21 packages/npm/knockback-pane-navigator.js
  24. +1 −1 packages/npm/knockback-pane-navigator.min.js
  25. +1 −1 packages/npm/package.json
  26. +31 −25 packages/nuget/Content/Scripts/knockback-page-navigator-panes.js
  27. +1 −1 packages/nuget/Content/Scripts/knockback-page-navigator-panes.min.js
  28. +1 −4 packages/nuget/Content/Scripts/knockback-page-navigator-simple.js
  29. +1 −1 packages/nuget/Content/Scripts/knockback-page-navigator-simple.min.js
  30. +30 −21 packages/nuget/Content/Scripts/knockback-pane-navigator.js
  31. +1 −1 packages/nuget/Content/Scripts/knockback-pane-navigator.min.js
  32. +1 −1 packages/nuget/package.nuspec
  33. +20 −0 src/knockback-pane-navigator/knockback-pane-navigator.coffee
  34. +1 −12 src/knockback-pane-navigator/knockout-bindings.coffee
  35. +2 −3 src/shared/knockback-page-navigator-helpers.coffee
  36. +1 −1 test/knockback-page-navigator-panes/test-latest-amd.html
  37. +1 −1 test/knockback-page-navigator-panes/test-latest.html
  38. +1 −1 test/knockback-page-navigator-simple/test-latest-amd.html
  39. +1 −1 test/knockback-page-navigator-simple/test-latest.html
  40. +1 −1 test/knockback-pane-navigator/test-latest-amd.html
  41. +1 −1 test/knockback-pane-navigator/test-latest.html
  42. +3 −3 test/vendor/{knockback-core-0.16.6.js → knockback-core-0.16.7.js}
  43. +4 −4 test/vendor/{knockback-core-stack-0.16.6.js → knockback-core-stack-0.16.7.js}
View
@@ -1,5 +1,9 @@
Please refer to the following release notes when upgrading your version of Knockback-Navigators.js.
+## 0.1.2
+
+* made pane navigator check for DOM changes using setInterval to ensure an active element is always present.
+
## 0.1.1
* added AMD loader to all components.
@@ -39,7 +39,7 @@ <h1>Page2</h1>
<script src="vendor/xui-2.3.2.js"></script>
<script src="vendor/path-0.8.4.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-panes.js"></script>
<script type='text/javascript'>
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</script>
<script src="vendor/jquery-1.8.0.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-panes.js"></script>
<script src="../lib/knockback-sample-transitions-jquery.js"></script>
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</script>
<script src="vendor/jquery-1.8.0.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-panes.js"></script>
<script src="../lib/knockback-sample-transitions-jquery.js"></script>
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</script>
<script src="vendor/jquery-1.8.0.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-panes.js"></script>
<script src="../lib/knockback-sample-transitions-jquery.js"></script>
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</div>
<script src="vendor/zepto-1.0rc1.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-panes.js"></script>
<script src="../lib/knockback-sample-transitions-jquery.js"></script>
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</script>
<script src="vendor/jquery-1.8.0.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-simple.js"></script>
<script type='text/javascript'>
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</div>
<script src="vendor/zepto-1.0rc1.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-simple.js"></script>
<script type='text/javascript'>
View
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</script>
<script src="vendor/jquery-1.8.0.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-simple.js"></script>
<script type='text/javascript'>
View
@@ -30,7 +30,7 @@ <h1 data-bind="text: title"></h1>
</div>
<script src="vendor/zepto-1.0rc1.js"></script>
- <script src="vendor/knockback-core-stack-0.16.6.js"></script>
+ <script src="vendor/knockback-core-stack-0.16.7.js"></script>
<script src="../knockback-page-navigator-simple.js"></script>
<script type='text/javascript'>
@@ -1,5 +1,5 @@
/*
- knockback-core-stack.js 0.16.6
+ knockback-core-stack.js 0.16.7
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -5938,7 +5938,7 @@ ko.exportSymbol('nativeTemplateEngine', ko.nativeTemplateEngine);
});
})(window,document,navigator);
/*
- knockback-core.js 0.16.6
+ knockback-core.js 0.16.7
(c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Dependencies: Knockout.js, Backbone.js, and Underscore.js.
@@ -5955,7 +5955,7 @@ ko.exportSymbol('nativeTemplateEngine', ko.nativeTemplateEngine);
}
})(function() {// Generated by CoffeeScript 1.3.3
/*
- knockback-core.js 0.16.6
+ knockback-core.js 0.16.7
(c) 2011, 2012 Kevin Malakoff.
Knockback.js is freely distributable under the MIT license.
See the following for full license details:
@@ -5970,7 +5970,7 @@ kb = (function() {
function kb() {}
- kb.VERSION = '0.16.6';
+ kb.VERSION = '0.16.7';
kb.TYPE_UNKNOWN = 0;
@@ -15,7 +15,7 @@
return factory.call(this);
}
})(function() {// Generated by CoffeeScript 1.3.3
-var bind, kb, ko, throwMissing, throwUnexpected, _;
+var ACTIVE_CHECK_INTERVAL, bind, checkPanesForActivate, kb, ko, root, throwMissing, throwUnexpected, _;
throwMissing = function(instance, message) {
throw "" + (_.isString(instance) ? instance : instance.constructor.name) + ": " + message + " is missing";
@@ -228,10 +228,33 @@ if (ko && ko.bindingHandlers) {
};
}
+root = this;
+
+ACTIVE_CHECK_INTERVAL = 100;
+
+checkPanesForActivate = function(pane_navigator) {
+ var $pane_els, active_pane, parent_el;
+ if (active_pane = pane_navigator.activePane()) {
+ parent_el = active_pane.el.parentNode;
+ while (parent_el && (parent_el !== pane_navigator.el)) {
+ parent_el = parent_el.parentNode;
+ }
+ if (parent_el) {
+ return;
+ }
+ pane_navigator.clear();
+ }
+ $pane_els = $(pane_navigator.el).children().filter('.pane');
+ if ($pane_els.length) {
+ return pane_navigator.push(new kb.Pane($pane_els[0]));
+ }
+};
+
kb.PaneNavigator = (function() {
function PaneNavigator(el, options) {
- var key, value;
+ var key, value,
+ _this = this;
el || throwMissing(this, 'el');
for (key in options) {
value = options[key];
@@ -240,9 +263,14 @@ kb.PaneNavigator = (function() {
this.panes = ko.observableArray();
this.el = el && el.length ? el[0] : el;
$(this.el).addClass('pane-navigator');
+ this.interval = root.setInterval(function() {
+ return checkPanesForActivate(_this);
+ });
}
PaneNavigator.prototype.destroy = function() {
+ root.clearInterval(this.interval);
+ this.interval = null;
this.el = null;
return this.clear({
silent: true
@@ -584,25 +612,6 @@ if (ko.bindingHandlers) {
return kb.utils.wrappedPaneNavigator(element, null);
});
return $(element).addClass('pane-navigator');
- },
- 'update': function(element, value_accessor) {
- var checkPanesForActivate;
- checkPanesForActivate = function() {
- var $pane_els, pane_navigator;
- pane_navigator = kb.utils.wrappedPaneNavigator(element);
- if (pane_navigator.activePane()) {
- return;
- }
- $pane_els = $(pane_navigator.el).children().filter('.pane');
- if ($pane_els.length) {
- return pane_navigator.push(new kb.Pane($pane_els[0]));
- }
- };
- if (element.children.length) {
- return checkPanesForActivate();
- } else {
- return setTimeout(checkPanesForActivate, 0);
- }
}
};
}
@@ -635,10 +644,7 @@ kb.loadUrlFn = function(url, transition) {
return function(vm, event) {
kb.loadUrl(url, transition);
(!vm || !vm.stopPropagation) || (event = vm);
- if (event && event.stopPropagation) {
- event.stopPropagation();
- return event.preventDefault();
- }
+ !(event && event.stopPropagation) || (event.stopPropagation(), event.preventDefault());
};
};

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -232,10 +232,7 @@ kb.loadUrlFn = function(url, transition) {
return function(vm, event) {
kb.loadUrl(url, transition);
(!vm || !vm.stopPropagation) || (event = vm);
- if (event && event.stopPropagation) {
- event.stopPropagation();
- return event.preventDefault();
- }
+ !(event && event.stopPropagation) || (event.stopPropagation(), event.preventDefault());
};
};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 950d7fd

Please sign in to comment.