Commit ecc8b177d24266f77d37b07a6409e4c4312ae4c0
1 parent
c7e42136
Exists in
master
and in
2 other branches
Improve VLibrasLocalization timing
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
app/assets/javascripts/v_libras/requests/workflow.js
| @@ -45,7 +45,7 @@ var VLibrasLocalization = function() { | @@ -45,7 +45,7 @@ var VLibrasLocalization = function() { | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | function _createButton(index, time) { | 47 | function _createButton(index, time) { |
| 48 | - if (time === _options.buttons[index].start) { | 48 | + if ((time > _options.buttons[index].start) && (_options.buttons[index].shown != true)) { |
| 49 | var image = null; | 49 | var image = null; |
| 50 | 50 | ||
| 51 | if (_options.buttons[index].clickable === true) { | 51 | if (_options.buttons[index].clickable === true) { |
| @@ -62,10 +62,14 @@ var VLibrasLocalization = function() { | @@ -62,10 +62,14 @@ var VLibrasLocalization = function() { | ||
| 62 | image.css('left', _options.buttons[index].x); | 62 | image.css('left', _options.buttons[index].x); |
| 63 | 63 | ||
| 64 | image.hide().appendTo(_video_wrapper).fadeIn(_options.buttons[index].delay); | 64 | image.hide().appendTo(_video_wrapper).fadeIn(_options.buttons[index].delay); |
| 65 | + | ||
| 66 | + _options.buttons[index].shown = true; | ||
| 65 | } | 67 | } |
| 66 | 68 | ||
| 67 | - if (time === _options.buttons[index].end) { | 69 | + if ((time > _options.buttons[index].end) && (_options.buttons[index].hidden != true)) { |
| 68 | $('#' + _options.buttons[index].id).fadeOut(_options.buttons[index].delay); | 70 | $('#' + _options.buttons[index].id).fadeOut(_options.buttons[index].delay); |
| 71 | + | ||
| 72 | + _options.buttons[index].hidden = true; | ||
| 69 | } | 73 | } |
| 70 | } | 74 | } |
| 71 | 75 |