checking for draggable property
01-28-2014, 06:06 PM, (This post was last modified: 01-28-2014, 06:20 PM by FunkyRes.)
Post: #1
checking for draggable property
In firefox

Code:
if (document.createElement('div').hasOwnProperty('draggable')) {
//do something
}

fails, yet firefox supports draggable objects.
Every other brother I've tried that works to detect it. But not firefox.

What is the best cross-browser way to feature test for draggable support?

Thank you for suggestions.

Oh and this is why I hate front-end dev crap. Someone should lock all these browser devs in a stinky room and not let them out until they have some consistency. Mouse position is really bad cross-browser, glad I don't need to do any of that.

ugg...

Code:
if('draggable' in document.createElement('div')) {

works in firefox (and so far elsewhere) - so figured it out, firefox for some reason just didn't like the way I asked before.
Welcome to the dark side. Are you surprised we lied about having cookies?
01-28-2014, 06:30 PM, (This post was last modified: 01-28-2014, 06:35 PM by FunkyRes.)
Post: #2
RE: checking for draggable property
Gah - almost, JSLint doesn't like that way, prefers hasOwnProperty like I was doing before.
I'll figure it out. I hope to make firefox happy with hasOwnProperty I don't have to create a node and test for property in separate line.

And according to stackexchange, iOS will report draggable is in the object but doesn't support drag and drop.

Fuck Apple.
Welcome to the dark side. Are you surprised we lied about having cookies?
01-29-2014, 03:48 PM,
Post: #3
RE: checking for draggable property
Linters, at the end of the day, are a suggestion.
The chaos army seems suspiciously well organized.
flickr | Stupid Blog | Twitter
01-29-2014, 06:23 PM,
Post: #4
RE: checking for draggable property
OHOOOOOOOOOOooo
01-30-2014, 09:28 AM,
Post: #5
RE: checking for draggable property
(01-29-2014, 03:48 PM)Gippy Wrote: Linters, at the end of the day, are a suggestion.

Yes they are, but I still prefer to come as clean as possible with them.
Welcome to the dark side. Are you surprised we lied about having cookies?
01-30-2014, 12:44 PM,
Post: #6
RE: checking for draggable property
Agreed, but don't waste too much time making the linter happy.
The chaos army seems suspiciously well organized.
flickr | Stupid Blog | Twitter


Forum Jump: