(val)
| 779 | }; |
| 780 | |
| 781 | function getStyleObj(val) { |
| 782 | var styleObj = {}; |
| 783 | |
| 784 | if(Lib.isPlainObject(val)) { |
| 785 | styleObj.id = val.id; |
| 786 | styleObj.style = val; |
| 787 | } else if(typeof val === 'string') { |
| 788 | styleObj.id = val; |
| 789 | |
| 790 | if(constants.stylesMap[val]) { |
| 791 | styleObj.style = constants.stylesMap[val]; |
| 792 | } else { |
| 793 | styleObj.style = val; |
| 794 | } |
| 795 | } else { |
| 796 | styleObj.id = constants.styleValueDflt; |
| 797 | styleObj.style = convertStyleVal(constants.styleValueDflt); |
| 798 | } |
| 799 | |
| 800 | styleObj.transition = {duration: 0, delay: 0}; |
| 801 | |
| 802 | return styleObj; |
| 803 | } |
| 804 | |
| 805 | // if style is part of the 'official' map values, add URL prefix and suffix |
| 806 | function convertStyleVal(val) { |
no test coverage detected
searching dependent graphs…