From 7bbd1eef5ffbb5fa14d98c2a667d38be2157b780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=94=8B?= Date: Wed, 17 Feb 2016 11:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20demo=20=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E9=94=99=E4=B9=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20location.hash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/example/example.js | 10 +--------- src/example/example.js | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/dist/example/example.js b/dist/example/example.js index 1879943..b444d74 100644 --- a/dist/example/example.js +++ b/dist/example/example.js @@ -9,7 +9,6 @@ $(function () { _pageStack: [], _configs: [], _defaultPage: null, - _isGo: false, default: function (defaultPage) { this._defaultPage = defaultPage; return this; @@ -19,12 +18,6 @@ $(function () { $(window).on('hashchange', function (e) { - var _isBack = !self._isGo; - self._isGo = false; - if (!_isBack) { - return; - } - var url = location.hash.indexOf('#') === 0 ? location.hash : '#'; var found = null; for(var i = 0, len = self._pageStack.length; i < len; i++){ @@ -70,7 +63,6 @@ $(function () { dom: $html }); - this._isGo = true; location.hash = config.url; if (!config.isBind) { @@ -122,7 +114,7 @@ $(function () { '.js_grid': { click: function (e) { var id = $(this).data('id'); - pageManager.go(id); + location.hash = id; } } } diff --git a/src/example/example.js b/src/example/example.js index 1879943..b444d74 100644 --- a/src/example/example.js +++ b/src/example/example.js @@ -9,7 +9,6 @@ $(function () { _pageStack: [], _configs: [], _defaultPage: null, - _isGo: false, default: function (defaultPage) { this._defaultPage = defaultPage; return this; @@ -19,12 +18,6 @@ $(function () { $(window).on('hashchange', function (e) { - var _isBack = !self._isGo; - self._isGo = false; - if (!_isBack) { - return; - } - var url = location.hash.indexOf('#') === 0 ? location.hash : '#'; var found = null; for(var i = 0, len = self._pageStack.length; i < len; i++){ @@ -70,7 +63,6 @@ $(function () { dom: $html }); - this._isGo = true; location.hash = config.url; if (!config.isBind) { @@ -122,7 +114,7 @@ $(function () { '.js_grid': { click: function (e) { var id = $(this).data('id'); - pageManager.go(id); + location.hash = id; } } }