pagesjs 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -69,7 +69,7 @@ For Ruby on Rails you can use gem for Assets Pipeline.
69
69
  3. Include Pages.js to your `application.js.coffee`:
70
70
 
71
71
  ```coffee
72
- #= require pagesjs
72
+ #= require pages
73
73
  ```
74
74
 
75
75
  ### Others
@@ -139,10 +139,11 @@
139
139
  // Start session history management. It’s called automatically on
140
140
  // document ready. You can use it manually after `Pages.disable` calling.
141
141
  enable: function() {
142
- if ( !this.disabled || !this.isSupported() ) {
142
+ if ( this._events || !this.isSupported() ) {
143
143
  return false;
144
144
  }
145
145
  this.disabled = false;
146
+ this._events = true;
146
147
 
147
148
  $(window).on('popstate.pages', function() {
148
149
  if ( Pages._lastUrl != location.href ) {
@@ -163,6 +164,7 @@
163
164
  $(this._document).off('click.pages', 'a');
164
165
  $(window).off('popstate.pages');
165
166
  this.disabled = true;
167
+ this._events = false;
166
168
  },
167
169
 
168
170
  // Show page by `url` with overrided page `data`. Return true if page is
@@ -298,6 +300,9 @@
298
300
  // Prevent double load page on double click.
299
301
  _lastUrl: null,
300
302
 
303
+ // Event listeners are already binded.
304
+ _events: false,
305
+
301
306
  // Find first current page.
302
307
  _findCurrent: function() {
303
308
  return $(this.pagesSelector + ':visible:first', this._document)
@@ -441,9 +446,7 @@
441
446
 
442
447
  animate: function(prev, next, done, data) {
443
448
  var half = this.duration / 2;
444
- console.log('start')
445
449
  prev.fadeOut(half, function() {
446
- console.log('half')
447
450
  next.fadeIn(half, done);
448
451
  });
449
452
  }
@@ -452,6 +455,8 @@
452
455
  $(document).ready(function() {
453
456
  Pages._lastUrl = location.href;
454
457
  Pages.init();
455
- Pages.enable();
458
+ if ( !Pages.disabled ) {
459
+ Pages.enable();
460
+ }
456
461
  });
457
462
  }).call(this, jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagesjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-01 00:00:00.000000000 Z
12
+ date: 2012-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets
16
- requirement: &16102460 !ruby/object:Gem::Requirement
16
+ requirement: &11613200 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.0.0.beta.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16102460
24
+ version_requirements: *11613200
25
25
  description: Pages.js allow you to manage pages JS code and forget about low-level
26
26
  History API.
27
27
  email: