You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remove class-related parameters for Element.data(). use attribute-related parameters instead, with a class key.
Element#styleObj() and Element#addStyleObj() are now OBSOLETE. Their functionality was added to Element#style() and Element#addStyle() respectively. Summary:
my_elem.style('background:none; font-weight:bold;')// set the [style] attribute, with a stringmy_elem.style({background:'none','font-weight':'bold'})// set the [style] attribute, with an objectmy_elem.style(null)// remove the [style] attributemy_elem.style()// return the value of [style], as a string (or `undefined` if the attribute has not been set)my_elem.style([])// return the value of [style], as an objectmy_elem.addStyle('background:none; font-weight:bold;')// add to the [style] attributemy_elem.addStyle({background:'none','font-weight':'bold'})// add to the [style] attributemy_elem.addStyle()// do nothing; return `this`
The [style] attribute is object-first, meaning all CSS is converted into an object before setting/adding styles, and then converted back into a string when rendered.
The default behavior of Element#addStyle() has changed. Instead of simply appending to the element’s [style] attribute, it now overwrites old CSS properties if given new values. For example, the following code
used to return 'background:none;font-weight:bold; font-weight:normal;', but the new behavior overrides duplicate properties, and so returns 'background:none;font-weight:normal;'.
Non-Breaking Changes
add new 'M j, Y' date format (“Mmm dd, yyyy”)
add default parameters to the following methods of Element:
Element#attrObj()
Element#attrStr()
Element#addClass()
Element#removeClass()
Element#addStyle()
Element#removeStyleProp()
Element.data() now parses instances of Element as their actual element, instead of a <dl> element (in the case of generic objects).