tmatt95 / OpenShut

Open Shut Jquery plugin.
GNU General Public License v3.0
0 stars 0 forks source link

Open status is only set once #5

Open tmatt95 opened 9 years ago

tmatt95 commented 9 years ago

The status does not update. As a result when the page loads the store may be open but then later on it could close but still be shown as being open in the system. It would be good to have the option to update the time periodically (perhaps through a callback function with a timer e.g

(setTimeout(function(){$('#element').openShut('reload');},3000) ))

tmatt95 commented 9 years ago

When the first object gets added to the page, it will create a javascript timer which will call a reload function every minute on the objects which have a specified class (probably "openshutreload"). To stop the timer from being added more than once, a data attribute will be added to the body tag when the first timer is added. When any more openshut objects are added, the javascript will not add is again.