cable_ready
Advanced tools
Comparing version 4.1.2 to 4.2.0
@@ -153,5 +153,7 @@ import morphdom from 'morphdom' | ||
dispatch(element, 'cable-ready:before-outer-html', detail) | ||
const parent = element.parentElement | ||
const ordinal = Array.from(parent.children).indexOf(element) | ||
element.outerHTML = html | ||
assignFocus(focusSelector) | ||
dispatch(element, 'cable-ready:after-outer-html', detail) | ||
dispatch(parent.children[ordinal], 'cable-ready:after-outer-html', detail) | ||
}, | ||
@@ -191,2 +193,9 @@ | ||
setProperty: detail => { | ||
const { element, name, value } = detail | ||
dispatch(element, 'cable-ready:before-set-property', detail) | ||
if (name in element) element[name] = value | ||
dispatch(element, 'cable-ready:after-set-property', detail) | ||
}, | ||
setValue: detail => { | ||
@@ -258,4 +267,4 @@ const { element, value } = detail | ||
for (let i = 0; i < entries.length; i++) { | ||
const detail = entries[i] | ||
try { | ||
const detail = entries[i] | ||
if (detail.selector) { | ||
@@ -271,6 +280,8 @@ detail.element = detail.xpath | ||
} catch (e) { | ||
if (entries[i].element) | ||
if (detail.element) | ||
console.log(`CableReady detected an error in ${name}! ${e.message}`) | ||
else | ||
console.log(`CableReady ${name} failed due to missing DOM element.`) | ||
console.log( | ||
`CableReady ${name} failed due to missing DOM element for selector: '${detail.selector}'` | ||
) | ||
} | ||
@@ -277,0 +288,0 @@ } |
{ | ||
"name": "cable_ready", | ||
"version": "4.1.2", | ||
"version": "4.2.0", | ||
"description": "CableReady helps you create great real-time user experiences by making it simple to trigger client-side DOM changes from server-side Ruby.", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"morphdom": "^2.5.12" | ||
"morphdom": "^2.6.1" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9997
251
Updatedmorphdom@^2.6.1