Skip to content

Commit

Permalink
Improved hint text show and hide functionality;
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrenklint committed Aug 25, 2011
1 parent bff1bf8 commit 6e434c1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
1 change: 1 addition & 0 deletions css/wunderlist.css
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ span.add_task_hint {
opacity:0.5;
-moz-opacity: 0.5;
filter:Alpha(opacity=50);
z-index: 1;
}

div.add .showdate {position:absolute; right:-70px !important; top:10px; font-size:11px; font-weight:bold; color:#fff}
Expand Down
52 changes: 42 additions & 10 deletions js/frontend/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,41 @@ $(function() {
});

// For testing purposes, to null the count, just uncomment this
//Titanium.App.Properties.setInt('number_of_shown_add_task_hints', 0);
Titanium.App.Properties.setInt('number_of_shown_add_task_hints', 0);

var numberOfShownHints = Titanium.App.Properties.getInt('number_of_shown_add_task_hints', 0) + 1;
var isShowingAgain = false;
if (numberOfShownHints < 5) {
$('.add_task_hint:hidden').live('click', function () { alert(); });
$('.addwrapper input').live('focus', function () {
if ($('.addwrapper input').val().length < 15) {
$('.add_task_hint').fadeIn('fast');
setTimeout(function () {
isShowingAgain = true;
$('.add_task_hint').fadeIn('fast', function () {
//isShowingAgain = false;
setTimeout(function () {
isShowingAgain = false;
}, 250);
});
}, 50);



/*
On blur, wait 200, check if VIEW is true
If NOT, hide
On focus, show
*/






}
setTimeout(function () {
if ($('.addwrapper input').val().length < 15) {
$('.add_task_hint').fadeIn('fast');
} else {
$('.add_task_hint').hide();
}
}, 250)
});
$('.addwrapper input').live('keyup', function () {
if ($('.addwrapper input').val().length < 15) {
Expand All @@ -331,9 +351,21 @@ $(function() {
}
});
$('.addwrapper input').live('blur', function () {
$('.add_task_hint').fadeOut('fast');

setTimeout(function () {
if (!isShowingAgain) {
$('.add_task_hint').fadeOut('fast');
}
}, 200);




});
Titanium.App.Properties.setInt('number_of_shown_add_task_hints', numberOfShownHints);



}

$('.addwrapper input').live('focus', function () {
Expand Down

0 comments on commit 6e434c1

Please sign in to comment.