Commits

Seph Soliman  committed a8ef576

added indication of time submission

  • Participants
  • Parent commits 999ba99

Comments (0)

Files changed (5)

File src/css/widget.css

 #reportcontainer div:first-child { margin: 0px 0px 15px; position: absolute; bottom: 0px; width: 248px; }
 #reporthours { width: 30px; font-size: 11px; margin: 0px 5px; }
 #reporttime { position: absolute; left: 0px; top: 0px; height: 25px; }
-#reportdescription { width: 179px; font-size: 11px; margin-top: 5px; }
+#reportdescription { width: 179px; font-size: 11px; margin-top: 5px; padding-right: 0px; }
+#reportdescription.loading { width: 159px; padding-right: 20px; }
 #reportdate_toggle { cursor: pointer; display: inline; color: #ccc; }
 #reportdate_toggle:hover { color: #fff; }
 #reportdate { position: absolute; right: 0px; top: 0px; }
 #todolist { height: 70px; overflow: auto; width: 200px; }
 #todos { width: 248px; margin-top: 30px; }
 #reportbtn { position: absolute; top: 56px; right: 0px; }
+#reportloader { position: absolute; top: 58px; right: 65px; background: #fff; }
 
 input[disabled] { opacity: .4; }
 input[type=text].fieldHelp { color: #999; }
 
+

File src/images/ajax-loader-submit.gif

Added
New image

File src/images/tick.png

Added
New image

File src/js/widget.js

 	$(".loadindicator").hide();
 	$(".loadindicator").ajaxStart(function() { $(this).show(); });
 	$(".loadindicator").ajaxStop(function() { $(this).hide(); });
+	$("#reportloader").hide();
 	// }}}
 	
 	// * Generate data for date-drop downs {{{
 	
 	opts.type = 'POST';
 	opts.url = timeURL;
-	opts.success = function(root) { /* Returns HTTP status code 201 (Created) on success, with the Location header set to the URL of the new time entry. The integer ID of the entry may be extracted from that URL*/ };
+	opts.success = function(root) {
+		$("#reportloader").attr('src', 'images/tick.png');
+		setTimeout(function() {
+			$("#reportloader").fadeOut(250);
+		}, 2000);
+		/* Returns HTTP status code 201 (Created) on success, with the Location header set to the URL of the new time entry. The integer ID of the entry may be extracted from that URL*/
+	};
+	$("#reportloader").attr('src', 'images/ajax-loader-submit.gif').show();
 	$.ajax(opts);
 }
 

File src/widget.html

 						<select id="todos"><option disabled="disabled" value="">Select a to-do &raquo;</option></select><br/>
 						<input type="text" value="" id="reportdescription" name="description" /><br/>
 						<div id="reportdate"><select id="reportdate_m"><option/></select><select id="reportdate_d"><option/></select><select id="reportdate_y"><option/></select></div>
-						<input type="button" id="reportbtn" value="Report" /><br/>
+						<input type="button" id="reportbtn" value="Report" /><img id="reportloader" src="images/ajax-loader-submit.gif" alt="Loading..." /><br/>
 					</div>
 				</div>