mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Mail and progressBar fixes.
This commit is contained in:
@@ -5,31 +5,32 @@ $(document).ready(function()
|
||||
var hash = event.target.href.toString().split('#')[1], form = $(event.target).parents('form')[0];
|
||||
window.location.hash = '/' + hash;
|
||||
if(form) {
|
||||
$(form).attr('action', $(form).attr('action').split('#')[0] + '#/' + hash);
|
||||
$(form).attr('action', $(form).attr('action').split('#')[0] + '#/' + hash);
|
||||
}
|
||||
});
|
||||
|
||||
// tabs hash
|
||||
if(/^#\/\w+/.test(window.location.hash)) {
|
||||
var hash = window.location.hash.substr(2);
|
||||
if(hash.match('^tab')) $('.nav-tabs a[href=#' + hash + ']').tab('show');
|
||||
if(hash.match('^tab')){ $('.nav-tabs a[href=#' + hash + ']').tab('show'); }
|
||||
}
|
||||
|
||||
$('.e-typeahead').each(function() {
|
||||
|
||||
$('.e-typeahead').each( function(){
|
||||
|
||||
var id = $(this).attr("id");
|
||||
var name = '#' + id.replace('-usersearch', '');
|
||||
var newval = $(this).attr("data-value");
|
||||
$(this).typeahead({
|
||||
source: $(this).attr("data-source"),
|
||||
updater: function(text, type){
|
||||
if(type == 'value')
|
||||
{
|
||||
$(name).val(text);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
})
|
||||
|
||||
$(this).typeahead({
|
||||
source: $(this).attr("data-source"),
|
||||
updater: function(text, type){
|
||||
if(type === 'value')
|
||||
{
|
||||
$(name).val(text);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* Switch to Tab containing invalid form field. */
|
||||
@@ -48,8 +49,8 @@ $(document).ready(function()
|
||||
found = true;
|
||||
//alert(node.id+' : '+tab);
|
||||
}
|
||||
// var label = $('label[for=' + node.id + ']');
|
||||
})
|
||||
// var label = $('label[for=' + node.id + ']');
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
@@ -124,7 +125,8 @@ $(document).ready(function()
|
||||
$('button[data-loading-text],a[data-loading-text]').on('click', function()
|
||||
{
|
||||
var caption = $(this).attr('data-loading-text');
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-primary');
|
||||
$(this).html(caption);
|
||||
if($(this).attr('data-disable') == 'true')
|
||||
{
|
||||
@@ -139,6 +141,7 @@ $(document).ready(function()
|
||||
var caption = $(this).attr('data-loading-text');
|
||||
$(this).val(caption);
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-primary');
|
||||
//$(this).attr('disabled', 'disabled').val(caption);
|
||||
return true;
|
||||
}
|
||||
@@ -203,8 +206,16 @@ $(document).ready(function()
|
||||
|
||||
|
||||
|
||||
var progresspump = null;
|
||||
|
||||
|
||||
$('.e-progress-cancel').on('click', function(e)
|
||||
{
|
||||
clearInterval(progresspump);
|
||||
var target = $(this).attr('data-progress-target');
|
||||
$("#"+target).closest('.progress').removeClass("active");
|
||||
progresspump = null;
|
||||
alert('stopped');
|
||||
});
|
||||
|
||||
$('.e-progress').on('click', function(e)
|
||||
{
|
||||
@@ -224,33 +235,33 @@ $(document).ready(function()
|
||||
|
||||
$("#"+target).css('width','1%'); // so we know it's running.
|
||||
|
||||
var progresspump = setInterval(function(){
|
||||
|
||||
progresspump = setInterval(function(){
|
||||
|
||||
$.get(script, { mode: mode }).done( function(data){
|
||||
|
||||
// alert(data);
|
||||
$("#"+target).css('width',data+'%'); // update the progress bar width */
|
||||
$("#"+target).html(data+'%'); // display the numeric value */
|
||||
// alert(data);
|
||||
$("#"+target).css('width', data+'%'); // update the progress bar width */
|
||||
$("#"+target).html(data+'%'); // display the numeric value */
|
||||
|
||||
if(data > 99.999) {
|
||||
|
||||
clearInterval(progresspump);
|
||||
|
||||
clearInterval(progresspump);
|
||||
$("#"+target).closest('.progress').removeClass("active");
|
||||
|
||||
$("#"+target).html("Done");
|
||||
|
||||
if(hide !== 'undefined')
|
||||
{
|
||||
$('#'+hide).hide();
|
||||
$('#'+hide).hide();
|
||||
}
|
||||
|
||||
if(show !== 'undefined')
|
||||
{
|
||||
$('#'+show).show('slow');
|
||||
$('#'+show).show('slow');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -695,7 +706,7 @@ $(document).ready(function()
|
||||
|
||||
// Text-area AutoGrow
|
||||
// $("textarea.e-autoheight").elastic();
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user