Preliminary UI for Play/Pause behaviour on hover state for notices
This commit is contained in:
parent
c9fcd73798
commit
a555963f97
|
@ -191,13 +191,13 @@ RealtimeUpdate = {
|
||||||
|
|
||||||
initActions: function(url, timeline, path)
|
initActions: function(url, timeline, path)
|
||||||
{
|
{
|
||||||
var NP = $('#notices_primary');
|
$('#notices_primary').prepend('<ul id="realtime_actions"><li id="realtime_playpause"></li><li id="realtime_timeline"></li></ul>');
|
||||||
NP.prepend('<ul id="realtime_actions"><li id="realtime_playpause"></li><li id="realtime_timeline"></li></ul>');
|
|
||||||
|
|
||||||
RealtimeUpdate._pluginPath = path;
|
RealtimeUpdate._pluginPath = path;
|
||||||
|
|
||||||
RealtimeUpdate.initPlayPause();
|
RealtimeUpdate.initPlayPause();
|
||||||
RealtimeUpdate.initAddPopup(url, timeline, RealtimeUpdate._pluginPath);
|
RealtimeUpdate.initAddPopup(url, timeline, RealtimeUpdate._pluginPath);
|
||||||
|
RealtimeUpdate.addNoticesHover();
|
||||||
},
|
},
|
||||||
|
|
||||||
initPlayPause: function()
|
initPlayPause: function()
|
||||||
|
@ -207,14 +207,14 @@ RealtimeUpdate = {
|
||||||
|
|
||||||
showPause: function()
|
showPause: function()
|
||||||
{
|
{
|
||||||
RT_PP = $('#realtime_playpause');
|
RealtimeUpdate._paused = false;
|
||||||
RT_PP.empty();
|
RealtimeUpdate.showQueuedNotices();
|
||||||
RT_PP.append('<button id="realtime_pause" class="pause" title="Pause">Pause</button>');
|
|
||||||
|
|
||||||
RT_P = $('#realtime_pause');
|
$('#realtime_playpause').remove();
|
||||||
RT_P.bind('click', function() {
|
$('#realtime_actions').prepend('<li id="realtime_playpause"><button id="realtime_pause" class="pause" title="Pause">Pause</button></li>');
|
||||||
RealtimeUpdate._paused = true;
|
|
||||||
|
|
||||||
|
$('#realtime_pause').bind('click', function() {
|
||||||
|
RealtimeUpdate.removeNoticesHover();
|
||||||
RealtimeUpdate.showPlay();
|
RealtimeUpdate.showPlay();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -222,18 +222,14 @@ RealtimeUpdate = {
|
||||||
|
|
||||||
showPlay: function()
|
showPlay: function()
|
||||||
{
|
{
|
||||||
RT_PP = $('#realtime_playpause');
|
RealtimeUpdate._paused = true;
|
||||||
RT_PP.empty();
|
|
||||||
RT_PP.append('<span id="queued_counter"></span> <button id="realtime_play" class="play" title="Play">Play</button>');
|
|
||||||
|
|
||||||
RT_P = $('#realtime_play');
|
$('#realtime_playpause').remove();
|
||||||
RT_P.bind('click', function() {
|
$('#realtime_actions').prepend('<li id="realtime_playpause"><span id="queued_counter"></span> <button id="realtime_play" class="play" title="Play">Play</button></li>');
|
||||||
RealtimeUpdate._paused = false;
|
|
||||||
|
|
||||||
|
$('#realtime_play').bind('click', function() {
|
||||||
|
RealtimeUpdate.addNoticesHover();
|
||||||
RealtimeUpdate.showPause();
|
RealtimeUpdate.showPause();
|
||||||
|
|
||||||
RealtimeUpdate.showQueuedNotices();
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -259,13 +255,32 @@ RealtimeUpdate = {
|
||||||
$('#realtime_playpause #queued_counter').empty();
|
$('#realtime_playpause #queued_counter').empty();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addNoticesHover: function()
|
||||||
|
{
|
||||||
|
$('#notices_primary .notices').hover(
|
||||||
|
function() {
|
||||||
|
if (RealtimeUpdate._paused === false) {
|
||||||
|
RealtimeUpdate.showPlay();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function() {
|
||||||
|
if (RealtimeUpdate._paused === true) {
|
||||||
|
RealtimeUpdate.showPause();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
removeNoticesHover: function()
|
||||||
|
{
|
||||||
|
$('#notices_primary .notices').unbind('hover');
|
||||||
|
},
|
||||||
|
|
||||||
initAddPopup: function(url, timeline, path)
|
initAddPopup: function(url, timeline, path)
|
||||||
{
|
{
|
||||||
var NP = $('#realtime_timeline');
|
$('#realtime_timeline').append('<button id="realtime_popup" title="Pop up in a window">Pop up</button>');
|
||||||
NP.append('<button id="realtime_popup" title="Pop up in a window">Pop up</button>');
|
|
||||||
|
|
||||||
var PP = $('#realtime_popup');
|
$('#realtime_popup').bind('click', function() {
|
||||||
PP.bind('click', function() {
|
|
||||||
window.open(url,
|
window.open(url,
|
||||||
'',
|
'',
|
||||||
'toolbar=no,resizable=yes,scrollbars=yes,status=no,menubar=no,personalbar=no,location=no,width=500,height=550');
|
'toolbar=no,resizable=yes,scrollbars=yes,status=no,menubar=no,personalbar=no,location=no,width=500,height=550');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user