Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
snowkeeper committed Oct 17, 2015
1 parent ed1acd3 commit 7706a1f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const styles = {
'backgroundColor': '#f7f7f7',
'border': 'none',
'height': '50px',
'zIndex': 1003,
'zIndex': 1003
},
'inputDiv': {
'paddingTop': 0,
'paddingRight': 0,
'paddingBottom': 0,
'paddingLeft': 8,
'height': '50px',
'height': '50px'
},
'searchList': {
'height': '300px',
Expand Down
22 changes: 20 additions & 2 deletions lib/tag-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Tagged extends React.Component {
let anchored = (
<div id={this.state.Anchored.searchBar} style={this.state.Anchored.styles.searchBar} className={this.state.Anchored.classes.searchBar} >
<div className={this.state.Anchored.classes.inputDiv} style={this.state.Anchored.styles.inputDiv}>
<input style={this.state.Anchored.styles.input} type="text" placeholder={this.state.Anchored.placeholder} className={this.state.Anchored.classes.input} />
<input disabled style={this.state.Anchored.styles.input} type="text" placeholder={this.state.Anchored.placeholder} className={this.state.Anchored.classes.input} />
<nav style={this.state.Anchored.styles.searchList} id={this.state.Anchored.searchList} className={this.state.Anchored.classes.searchList}></nav>
</div>
</div>
Expand Down Expand Up @@ -101,9 +101,13 @@ class Tagged extends React.Component {
})

// jump to first anchor on page that matches and give a list of matches
$(document).on('input focus', '#' + thisComponent.state.Anchored.searchBar + ' input', function(e) {
$(document).on('click input focus', '#' + thisComponent.state.Anchored.searchBar + ' input', function(e) {
thisComponent.wordWait(e.target.value);
});
// jump to first anchor on page that matches and give a list of matches
$(document).on('dblclick', '#' + thisComponent.state.Anchored.searchBar + ' input', function(e) {
thisComponent.checkTyping();
});

}
setVars() {
Expand All @@ -114,6 +118,20 @@ class Tagged extends React.Component {
thisComponent.$allAnchors = $(thisComponent.state.Anchored.tagSelector)
return true;
}
checkTyping() {
if(this._typingAllowed) {
this.allowTyping()
} else {
this.disAllowTyping()
}
this.typingAllowed = !this.typingAllowed
}
allowTyping() {
return this.$searchInput.prop('disabled', false)
}
disAllowTyping() {
return this.$searchInput.prop('disabled', true)
}
catchMenuClick (e) {
const thisComponent = this
// catch a menu click and close any menus
Expand Down

0 comments on commit 7706a1f

Please sign in to comment.