evertiro / historical-redux2

A simple, easily extendable options framework for WordPress based on NHP Theme Options Framework.
http://reduxframework.com
Other
105 stars 43 forks source link

Upload Type not notifying changes should be saved #69

Closed ghost closed 11 years ago

ghost commented 11 years ago

When using the upload type, after selecting or removing an image, the "Settings have changed, you should save them!" box does not appear.

denis0706 commented 11 years ago

It happens because we change only value of 'Upload Type' input with javascript, but 'change' event isn't triggered. But notify is shown only when this event is triggered. So we can add .trigger('change'); while we change some values of input fields such as 'Upload Type' : how it is now, how it must be: jQuery('#' + formfield).val(imgurl).trigger('change');

Another problem i have found - event handler is bind only for inputs/selects/textareas that have been existed by the time of binding. Fox exampe changing 'Multi Text Option' field won't show notify. So we must use delegated events to solve this problem. How it is now. How it should be.