fix status rename bug
This commit is contained in:
parent
b20c9d1bd8
commit
c5288b19a5
@ -54,6 +54,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<input type="text" id="new_status" placeholder="Column name" autofocus>
|
<input type="text" id="new_status" placeholder="Column name" autofocus>
|
||||||
|
<input type="hidden" id="new_status_id">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="submit" name="change_status" value="Change column name">
|
<input type="submit" name="change_status" value="Change column name">
|
||||||
|
|||||||
@ -75,26 +75,25 @@ var App = function() {
|
|||||||
$('#change-status-modal').removeClass('hide');
|
$('#change-status-modal').removeClass('hide');
|
||||||
|
|
||||||
$('#new_status').val($(this).text());
|
$('#new_status').val($(this).text());
|
||||||
|
$('#new_status_id').val(statusToChange);
|
||||||
|
});
|
||||||
|
$('#change-status-modal').find('form').on('submit', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
var newStatus = $('#new_status').val();
|
||||||
|
var newStatusId = $('#new_status_id').val();
|
||||||
|
var currentStatus = JSON.parse(LocalStorage.get('status'));
|
||||||
|
currentStatus.map(function(obj){
|
||||||
|
if(obj.key == newStatusId)
|
||||||
|
{
|
||||||
|
obj.value = newStatus;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#change-status-modal').find('form').on('submit', function(e){
|
$('header ul li[data-id=' + newStatusId + ']').html(newStatus);
|
||||||
e.preventDefault();
|
|
||||||
var newStatus = $('#new_status').val();
|
|
||||||
var currentStatus = JSON.parse(LocalStorage.get('status'));
|
|
||||||
currentStatus.map(function(obj){
|
|
||||||
if(obj.key == statusToChange)
|
|
||||||
{
|
|
||||||
obj.value = newStatus;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('header ul li[data-id=' + statusToChange + ']').html(newStatus);
|
LocalStorage.set('status', JSON.stringify(currentStatus));
|
||||||
|
|
||||||
LocalStorage.set('status', JSON.stringify(currentStatus));
|
$('.close-modal').trigger('click');
|
||||||
|
|
||||||
|
|
||||||
$('.close-modal').trigger('click');
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user