New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- Added rotating tips. 5 tips that cycle every 60 seconds with fadeout/fadein #390
Conversation
}); | ||
|
||
$('#message-instruction').fadeIn(2000, recursiveTimeout()); | ||
}, 60 * 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean, the time in milliseconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something readable.
- Refactored the setTimeout time to a constant.
Updated. |
var cycleTimeInMilliseconds = 60 * 1000; // 1 minute. | ||
var currentTipIndex = 0; | ||
|
||
function recursiveTimeout() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change name to cycleMessages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
var cycleTimeInMilliseconds = 60 * 1000; // 1 minute. | ||
var cycleMessageIndex = 0; | ||
|
||
function recursiveTimeout() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the name of recursiveTimeout to cycleMessages...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
(sorry about the slow update -> weekends, kids, no life, QQ....)
- Renamed the messages array.
Why is this code in index.htm? |
3 reasons.
I would prefer to have it in a js file. Any preference? chat.ui.js? |
Yes move it to the ui file :). |
…Chat.ui.js - CycleMessages are now started when the document has finished loading.
Ok. done. few points to note:
with this
|
}; | ||
|
||
// Start cycling the messages once the document has finished loading. | ||
$(document).ready(cycleMessages()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea this is all wrong and doesnt follow the pattern we use today. Kick it off in ui.initialize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. (added to the bottom of the ui.init. I didn't know that function existed. Awesome!)
…g to ui.initialize function. (Cheers DFowler) - BugFix: a function calla was getting invoked immediately. Refactored to be a function reference instead. (Cheers redsquare)
- Added rotating tips. 5 tips that cycle every 60 seconds with fadeout/fadein
5 Tips :-
Fade Out / Fade In = 2 secs each.
Rotate is set for every 60 seconds.
** Apologies for the 2nd commit. I wanted to get my style, right.