mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +01:00
Small fix for jQuery / Ajax processing.
This commit is contained in:
@@ -157,9 +157,7 @@ $(function(){
|
||||
} else {
|
||||
$(this).data('toggle-state', 'on');
|
||||
$.get('@path/@repository.owner/@repository.name/issues/label/edit', function(data){
|
||||
var parent = $('#label-list').parent();
|
||||
$('#label-list').remove();
|
||||
parent.append(data);
|
||||
$('#label-list').parent().empty().html(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,10 +18,9 @@
|
||||
}
|
||||
</form>
|
||||
<script>
|
||||
@if(mode == "new"){
|
||||
$(function(){
|
||||
@if(mode == "new"){
|
||||
$('#newColor').colorpicker();
|
||||
});
|
||||
} else {
|
||||
$('#editColor').colorpicker();
|
||||
|
||||
@@ -33,9 +32,7 @@
|
||||
|
||||
if($.isEmptyObject(data)){
|
||||
$.post(form.attr('action'), $(form).serialize(), function(data){
|
||||
var parent = $('#label-edit').parent();
|
||||
$('#label-edit').remove();
|
||||
parent.append(data);
|
||||
$('#label-edit').parent().empty().html(data);
|
||||
});
|
||||
} else {
|
||||
$.each(data, function(key, value){
|
||||
@@ -46,6 +43,7 @@
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -13,14 +13,13 @@
|
||||
}
|
||||
</ul>
|
||||
<script>
|
||||
$(function(){
|
||||
$('i.icon-remove-circle').click(function(e){
|
||||
e.stopPropagation();
|
||||
if(confirm('Are you sure you want to delete this?')){
|
||||
$.get('@path/@repository.owner/@repository.name/issues/label/' + $(this).parents('a').data('label-id') + '/delete',
|
||||
function(data){
|
||||
var parent = $('#label-edit').parent();
|
||||
$('#label-edit').remove();
|
||||
parent.append(data);
|
||||
$('#label-edit').parent().empty().html(data);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -42,5 +41,6 @@
|
||||
$('div#label-edit li').css('border', '1px solid white');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user