Skip to content

Instantly share code, notes, and snippets.

@jespada
Created March 25, 2014 13:36
Show Gist options
  • Save jespada/9761889 to your computer and use it in GitHub Desktop.
Save jespada/9761889 to your computer and use it in GitHub Desktop.
view.js double click
var self = this;
this.clickFocusable = true;
this.el.dblclick(function() {
if (self.clickFocusable) {
self.focus();
}
});
};
types.View = View;
@jespada
Copy link
Author

jespada commented Mar 25, 2014

or something like focus only when clicking not when selecting (when you release the selection will trigger focus b default):

   var self = this;
    this.clickFocusable = true;
    this.clickSelected = self.mouseup  //not sure here..
    this.el.click(function() {
//trying to find a way to select or highlight but not focus(just want to copy)
      if (self.clickFocusable && !self.clickSelected {
        self.focus();
      }
    });
  };
  types.View = View;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment