dperini/nwmatcher — Issue #46: How to use NWMatcher?
Author: olivierdb
Created: 2011-10-25 21:02:06+00:00
State: open

Would you please help me "translate" the following javascript using NWMatcher:

function toggle_visibility(item) {
var sr = NW.Dom.byId('vue_simple-'+item);
var dr = NW.Dom.byId('vue_detaillee-'+item);
if (sr.style.display != 'none') {
sr.setAttribute('style','display: none');
dr.setAttribute('style','display: block !important');
}
else {
dr.setAttribute('style','display: none');
sr.setAttribute('style','display: block');
}
}

Above, I already replaced document.getElementById with NW.Dom.byId

Is this correct?

Thkx for your help.