mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
more clever prefix detection. (use unprefixed property when available.)
This commit is contained in:
@@ -53,7 +53,7 @@ iD.Map = function() {
|
||||
class_fill = iD.Style.styleClasses('stroke'),
|
||||
class_area = iD.Style.styleClasses('area'),
|
||||
class_casing = iD.Style.styleClasses('casing'),
|
||||
transformProp = iD.util.prefix(['webkit', 'ms', 'Moz']) + 'transform',
|
||||
transformProp = iD.util.prefixProperty('Transform'),
|
||||
support3d = (function() {
|
||||
// test for translate3d support. Based on https://gist.github.com/3794226 by lorenzopolidori and webinista
|
||||
var el = document.createElement('div'),
|
||||
|
||||
@@ -72,6 +72,15 @@ iD.util.prefix = function(browsers) {
|
||||
return '';
|
||||
})(browsers);
|
||||
};
|
||||
iD.util.prefixProperty = function(property) {
|
||||
prefixes = ['webkit', 'ms', 'Moz', 'O'];
|
||||
return (function prefixMatch(p) { // via mbostock
|
||||
var i = -1, n = p.length, s = document.body.style;
|
||||
if (property.toLowerCase() in s) return property.toLowerCase();
|
||||
while (++i < n) if (p[i] + property in s) return '-' + p[i].toLowerCase() + '-' + property.toLowerCase();
|
||||
return '';
|
||||
})(prefixes);
|
||||
};
|
||||
|
||||
iD.util.geo = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user