Permalink
Browse files

Added pubsub events for Kalendae.Input showing and hiding when the in…

…put gains and loses focus

Closes Issue #59
  • Loading branch information...
1 parent da4b857 commit 2100daa111481468d94643618a7baed5f291cb9e @Twipped committed Aug 29, 2012
Showing with 20 additions and 10 deletions.
  1. +3 −1 build/kalendae.js
  2. +8 −8 build/kalendae.min.js
  3. +6 −0 readme.md
  4. +3 −1 src/input.js
View
@@ -879,11 +879,13 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, {
}
style.position = util.isFixed($input) ? 'fixed' : 'absolute';
-
+
+ this.publish('show', this);
},
hide : function () {
this.container.style.display = 'none';
+ this.publish('hide', this);
}
});
View

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

Oops, something went wrong.
View
@@ -214,6 +214,12 @@ Kalendae offers the following events:
- `view-changed` - Fires when the user has clicked the next or previous month button, but before the calendar is redrawn. Returning false will prevent the change.
+Additionally, Kalendae.Input provides the following events:
+
+- `show` - Fires when the calendar appears due to the input gaining focus
+
+- `hide` - Fires when the calendar hides due to the input blurring
+
##Skinning Kalendae
View
@@ -120,11 +120,13 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, {
}
style.position = util.isFixed($input) ? 'fixed' : 'absolute';
-
+
+ this.publish('show', this);
},
hide : function () {
this.container.style.display = 'none';
+ this.publish('hide', this);
}
});

0 comments on commit 2100daa

Please sign in to comment.