marionnewlevant / craft-snitch

Craft plugin. Report when two people might be editing the same entry, category, or global
MIT License
35 stars 16 forks source link

Fix bugs, refine warning. #1

Closed mattstein closed 7 years ago

mattstein commented 7 years ago
marionnewlevant commented 7 years ago

Hey Matt, I'm about to incorporate most of this (many thanks!), but if possible I'd like to handle the sliding up and down in css, so that people can override that in css if they want to. Can you think of a reasonable way to do that?

mattstein commented 7 years ago

Hi Marion! That's a great idea and an interesting problem. Animation in could be a simple matter of using keyframes, while animation out (prior to DOM removal) is more challenging. This suggestion seems like it could work...

  1. When it's time to remove the bar, briefly give it a .removing class.
  2. Wait a predefined interval, like 200ms (jQuery's "fast" value), which could be a configuration option in the plugin. Have the CSS animate the bar out within this timespan.
  3. Finally have the JavaScript remove the bar from the DOM.

This means someone could easily style the bar including her own transitions, with the requirement to override them in CSS and drop the removal delay to disable them completely. I think that's better despite being slightly cumbersome.

People with sad, old browsers probably aren't able to use the control panel anyway, so the CSS transition method shouldn't be an issue.