Skip to content

Commit

Permalink
- enabled Fx.ProgressBar fit by default. Now you can resize your pro…
Browse files Browse the repository at this point in the history
…gressbars (yay)

 - Fixed MooTools.lang simulation
  • Loading branch information
Harald Kirschner committed Apr 30, 2009
1 parent 2a40a5f commit 8d7ce8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 13 additions & 1 deletion source/FancyUpload2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* FancyUpload - Flash meets Ajax for powerful and elegant uploads.
*
* Updated to latest 3.0 API. Hopefully 100% compat!
*
* @version 3.0-rc0
*
Expand Down Expand Up @@ -56,6 +58,10 @@ var FancyUpload2 = new Class({
text: new Element('span', {'class': 'progress-text'}).inject(progress, 'after')
});

progress.addEvent('click', function() {
this.currentProgress.start($random(0, 100));
}.bind(this));

this.updateOverall();
},

Expand Down Expand Up @@ -205,6 +211,7 @@ FancyUpload2.File = new Class({

});

// Avoiding MooTools.lang depedency
(function() {
var phrases = {
'progressOverall': 'Overall Progress ({total})',
Expand All @@ -230,5 +237,10 @@ FancyUpload2.File = new Class({
};

if (MooTools.lang) MooTools.lang.set('en-US', 'FancyUpload', phrases);
else MooTools.lang = new Hash({'FancyUpload': phrases});
else MooTools.lang = {
get: function(from, key) {
console.log(key);
return phrases[key];
}
};
})();
3 changes: 1 addition & 2 deletions source/Fx.ProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Fx.ProgressBar = new Class({
text: null,
url: null,
transition: Fx.Transitions.Circ.easeOut,
fit: false,
fit: true,
link: 'cancel'
},

Expand All @@ -33,7 +33,6 @@ Fx.ProgressBar = new Class({
});
}

// experimental
if (this.options.fit) {
url = url || this.element.getStyle('background-image').replace(/^url\(["']?|["']?\)$/g, '');
if (url) {
Expand Down

0 comments on commit 8d7ce8e

Please sign in to comment.