mishk0 / swiped

Swiped.js - pretty swipe list for your mobile application, written in pure JS
MIT License
302 stars 32 forks source link

Why " (styles.OLink === '' && ['', 'o']) " ? #1

Closed thinkininfinity closed 9 years ago

thinkininfinity commented 9 years ago

What's the thinking and consecution behind this sentence?

mishk0 commented 9 years ago
pre = (Array.prototype.slice
      .call(styles)
      .join('') 
      .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
    )[1]

We are searching a known prefix type, settling on Opera if none is found, because only Opera (Presto) has a -o-link. Then you get:

pre = (['', 'o'])[1] // 'o' 
thinkininfinity commented 9 years ago

Okay, i got the result, thanks.

But there is last question: I couldn't find any infomation about the property "OLink", what is it ?

mishk0 commented 9 years ago

You can find it here http://www.opera.com/docs/specs/opera7/

thinkininfinity commented 9 years ago

Thanks again.