News for hackers. Stuff that matters.
Re:Picozu - the HTML5 Adobe Photoshop clone by kreek on Tuesday February 28, 2012 @11:34AM (#3643730)
This is pretty cool, with this app (and a lot of other HTML5 apps) I often have an issue where it acts as if I'm trying to select text as if I was going to copy and paste. The result is the entire app gets the 'text-selected' blue overlay. Anyone know of way to prevent this? I'm not sure that e.preventDefaut() stops it.
Re:Picozu - the HTML5 Adobe Photoshop clone by jarek-foksa on Tuesday February 28, 2012 @03:31PM (#3644837)
When building desktop-like apps I'm using following snippet to disable text selection everywhere:

  body * {
    -webkit-user-select: none;
    -moz-user-select:    none;
    -ms-user-select:     none;
    user-select:         none;
  }
Then I whitelist any elements that should be selectable:

  textarea,
  input,
  [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select:    text;
    -ms-user-select:     text;
    user-select:         text;
  }
Re:Picozu - the HTML5 Adobe Photoshop clone by mofle on Tuesday February 28, 2012 @12:29PM (#3643969)
You can use CSS user-select:none; on the elements you want to prevent selection on.