From 064322c7005b4f0889d063eff9bfa5b09d5353af Mon Sep 17 00:00:00 2001 From: RubaXa Date: Wed, 9 Jul 2014 10:42:21 +0400 Subject: [PATCH] #1: IE8 & cssHooks --- src/Ply.es6 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Ply.es6 b/src/Ply.es6 index 937207f..8aee41e 100644 --- a/src/Ply.es6 +++ b/src/Ply.es6 @@ -39,7 +39,7 @@ support = (() => { var props = {}, style = _buildDOM().style, - names = 'transition transform perspective transformStyle transformOrigin backfaceVisibility'.split(' '), + names = 'opacity transition transform perspective transformStyle transformOrigin backfaceVisibility'.split(' '), prefix = ['Webkit', 'Moz', 'O', 'MS'] ; @@ -71,6 +71,13 @@ }, + /** + * Хуки для css + * @type {Object} + */ + _cssHooks = { + }, + array_core = [], array_push = array_core.push, array_splice = array_core.splice, @@ -79,6 +86,17 @@ ; + // + // Определяем css-хуки + // + if (!support.opacity) { + _cssHooks.opacity = function (style, value) { + style.zoom = 1; + style.filter = 'alpha(opacity=' + (value * 100) + ')'; + }; + } + + // // Вспомогательные методы // @@ -345,6 +363,8 @@ } return prop === void 0 ? val : val[prop]; + } else if (_cssHooks[prop]) { + _cssHooks[prop](el.style, val); } else { el.style[support[prop] || prop] = val; } @@ -1659,6 +1679,8 @@ }; Ply.css = _css; + Ply.cssHooks = _cssHooks; + Ply.keys = keys; Ply.noop = noop; Ply.each = _each;