Skip to content

Commit

Permalink
Added pubsub events for Kalendae.Input showing and hiding when the in…
Browse files Browse the repository at this point in the history
…put gains and loses focus

Closes Issue #59
  • Loading branch information
Twipped committed Aug 29, 2012
1 parent da4b857 commit 2100daa
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
4 changes: 3 additions & 1 deletion build/kalendae.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

});
Expand Down
16 changes: 8 additions & 8 deletions build/kalendae.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

});
Expand Down

0 comments on commit 2100daa

Please sign in to comment.