dist/tao.js in tao_on_rails-0.5.1 vs dist/tao.js in tao_on_rails-0.5.2
- old
+ new
@@ -27895,16 +27895,16 @@
};
TaoApplication.prototype._initTurbolinks = function() {
return $(document).on('turbolinks:before-visit', (function(_this) {
return function(e) {
- var ref;
- if (_this.currentPage.trigger('before-leave') === false) {
+ var ref, ref1;
+ if (((ref = _this.currentPage) != null ? ref.trigger('before-leave') : void 0) === false) {
e.preventDefault();
return;
}
- return _this.trigger('before-page-visit', [(ref = e.originalEvent) != null ? ref.data.url : void 0]);
+ return _this.trigger('before-page-visit', [(ref1 = e.originalEvent) != null ? ref1.data.url : void 0]);
};
})(this)).on('turbolinks:request-start', (function(_this) {
return function(e) {
var ref;
return _this.trigger('page-request-start', [(ref = e.originalEvent) != null ? ref.data.xhr : void 0]);
@@ -27914,13 +27914,15 @@
var ref;
return _this.trigger('page-visit', [(ref = e.originalEvent) != null ? ref.data.url : void 0]);
};
})(this)).on('turbolinks:before-cache', (function(_this) {
return function(e) {
- var base;
+ var ref;
_this.trigger('before-page-cache', [_this.currentPage]);
- if (typeof (base = _this.currentPage).prepareCache === "function") {
- base.prepareCache();
+ if ((ref = _this.currentPage) != null) {
+ if (typeof ref.prepareCache === "function") {
+ ref.prepareCache();
+ }
}
return window.currentPage = _this.currentPage = null;
};
})(this)).on('turbolinks:request-end', (function(_this) {
return function(e) {