
Have a list of all the items in the Page that has PIE
Hi All
I have an issue in my project to maintain all the items that have PIE behaviour.
I have a Web 2.0 page so dynamically rendering different part of the page, as a result i have to update the position and size of the pie container after a render happen.
Solution:
I am adding a registory, that holds all the reff of the componets @ init and call the update on all the items
Code:
PIE[ 'attach' ] = function (el) {
if (PIE.ieDocMode < 10 && PIE.supportsVML) {
PIE.Element.getInstance(el).init();
PIE.Element.setPieIndex(el,PIE._registry.length)
PIE._registry.push(el)
}
};
/**
* Programatically detach PIE from a single element.
* @param {Element} el
*/
PIE[ 'detach' ] = function (el) {
PIE._registry.splice(PIE.Element.getPieIndex(el),1)
PIE.Element.destroy(el);
};
PIE['updateAll'] = function () {
for (var pieIndex = 0, pieLength = PIE._registry.length; pieIndex < pieLength; pieIndex++) {
PIE.Element.getInstance(PIE._registry[pieIndex]).update()
}
}