|
From: <dbr...@kr...> - 2007-04-09 18:20:24
|
Revision: 3714
Author: dbrodale
Date: 2007-04-09 13:20:17 -0500 (Mon, 09 Apr 2007)
Log Message:
-----------
JS: fix an invalid variable reference and reduce maximal bar width in Krang.update_progress()
Modified Paths:
--------------
branches/ajax_and_new_skin/htdocs/js/krang.js
branches/ajax_and_new_skin/htdocs/js/scriptaculous/controls.js
Modified: branches/ajax_and_new_skin/htdocs/js/krang.js
===================================================================
--- branches/ajax_and_new_skin/htdocs/js/krang.js 2007-04-06 14:53:24 UTC (rev 3713)
+++ branches/ajax_and_new_skin/htdocs/js/krang.js 2007-04-09 18:20:17 UTC (rev 3714)
@@ -407,19 +407,19 @@
width, sets the percentage counter (with id "progress_bar_percent")
and the optionally updates a label (with id "progress_bar_label")
*/
-Krang.update_progress = function(count, total, label) {
- var bar = document.getElementById('progress_bar');
- var perc = document.getElementById('progress_bar_percent');
- var prog = ( count + 1 ) / total;
+Krang.update_progress = function( count, total, label ) {
+ var bar = document.getElementById('progress_bar');
+ var percent = document.getElementById('progress_bar_percent');
+ var progress = ( count + 1 ) / total;
// can't go over 100%
- if( prog > 1 ) prog = 1;
+ if ( progress > 1 ) progress = 1;
- var width = Math.floor( prog * 400 );
+ var width = Math.floor( progress * 297 );
- bar.style.width = width + 'px';
- perc.innerHTML = Math.floor( prog * 100) + '%';
- if( label ) document.getElementById('progress_bar_label').innerHTML = string;
+ bar.style.width = width + 'px';
+ percent.innerHTML = Math.floor( progress * 100 ) + '%';
+ if ( label ) document.getElementById( 'progress_bar_label' ).innerHTML = label;
};
/*
Modified: branches/ajax_and_new_skin/htdocs/js/scriptaculous/controls.js
===================================================================
--- branches/ajax_and_new_skin/htdocs/js/scriptaculous/controls.js 2007-04-06 14:53:24 UTC (rev 3713)
+++ branches/ajax_and_new_skin/htdocs/js/scriptaculous/controls.js 2007-04-09 18:20:17 UTC (rev 3714)
@@ -185,6 +185,19 @@
},
onBlur: function(event) {
+/*@cc_on
+alert('hi');
+ if (
+ event
+ && ( Element.getStyle( this.update, 'height' ) != '' )
+ && Position.within( this.update, Event.pointerX( event ), Event.pointerY( event ) )
+ )
+ {
+ Event.observe( this.update, 'blur', this.onBlur.bindAsEventListener( this ), true );
+ return;
+ }
+@*/
+
// needed to make click events working
setTimeout(this.hide.bind(this), 250);
this.hasFocus = false;
|