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 {
|
} else {
|
||||||
$(this).data('toggle-state', 'on');
|
$(this).data('toggle-state', 'on');
|
||||||
$.get('@path/@repository.owner/@repository.name/issues/label/edit', function(data){
|
$.get('@path/@repository.owner/@repository.name/issues/label/edit', function(data){
|
||||||
var parent = $('#label-list').parent();
|
$('#label-list').parent().empty().html(data);
|
||||||
$('#label-list').remove();
|
|
||||||
parent.append(data);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,10 +18,9 @@
|
|||||||
}
|
}
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
@if(mode == "new"){
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
@if(mode == "new"){
|
||||||
$('#newColor').colorpicker();
|
$('#newColor').colorpicker();
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
$('#editColor').colorpicker();
|
$('#editColor').colorpicker();
|
||||||
|
|
||||||
@@ -33,9 +32,7 @@
|
|||||||
|
|
||||||
if($.isEmptyObject(data)){
|
if($.isEmptyObject(data)){
|
||||||
$.post(form.attr('action'), $(form).serialize(), function(data){
|
$.post(form.attr('action'), $(form).serialize(), function(data){
|
||||||
var parent = $('#label-edit').parent();
|
$('#label-edit').parent().empty().html(data);
|
||||||
$('#label-edit').remove();
|
|
||||||
parent.append(data);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.each(data, function(key, value){
|
$.each(data, function(key, value){
|
||||||
@@ -46,6 +43,7 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,14 +13,13 @@
|
|||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
<script>
|
<script>
|
||||||
|
$(function(){
|
||||||
$('i.icon-remove-circle').click(function(e){
|
$('i.icon-remove-circle').click(function(e){
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if(confirm('Are you sure you want to delete this?')){
|
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',
|
$.get('@path/@repository.owner/@repository.name/issues/label/' + $(this).parents('a').data('label-id') + '/delete',
|
||||||
function(data){
|
function(data){
|
||||||
var parent = $('#label-edit').parent();
|
$('#label-edit').parent().empty().html(data);
|
||||||
$('#label-edit').remove();
|
|
||||||
parent.append(data);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -42,5 +41,6 @@
|
|||||||
$('div#label-edit li').css('border', '1px solid white');
|
$('div#label-edit li').css('border', '1px solid white');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user