Closed ExceptionLimeCat closed 9 years ago
The plugin uses 3 different methods to detect an attribute change
and the plugin prefers to choose one of the above compatible methods based on the browser.
Regarding the issue,
Also The line 114 is the correct way to bind an event in jQuery. The 'on' is removed when binding an event in jQuery.
Please post a your code so I look into this in detail.
I probably should have mentioned this was an issue in SharePoint Online... I'm not sure if you want to support that (wouldn't blame you if you didn't), but I will try and reproduce the issue. I basically had to force IE 11 to use the onpropertychange in order to capture when SharePoint sets the s4-bodyContainer element to a static height in the style attribute.
I never had a chance to work on Share Point. I am adding some new features to the plugin soon which includes polling, which should work for you.
I will be closing this issue later today unless if I hear otherwise.
Added extensions to the plugin which has polling. Refer to the examples https://github.com/meetselva/attrchange/blob/master/examples/ html for more information.
I have very similar problem with looking after s4-workspace container in SharePoint 2013. I'm using IE11, but SP adds to the header to avoid other compatibility issues. As a result Mutation Observer method doesn't work and attrchage is using DOMAttrModified method. I am using the code as simple as this:
$('#s4-workspace').attrchange({ trackValues: true, callback: function (e) { console.log(e.newValue) }});
I am getting results in console for changes that appear in #s4-workspace attributes, but I also get hundreds of records from other elements as well which is giving unnecessary load to the browser.
Any chances to limit to just selected element?
I ran across this issue the other day. You check for 'onpropertychange' at line 113 but then attach the listener to the 'propertychange' property. I had to change line 114 to say 'onpropertychange' to resolve this issue in IE 11. This obviously isn't backwards compatible but I did want to make sure this issue was known.