(refs #246)Fix issue editing

This commit is contained in:
takezoe
2014-01-18 01:52:34 +09:00
parent 226a8af262
commit ccc1e9bc8b

View File

@@ -4,8 +4,8 @@
<input type="text" style="width: 680px;" id="edit-title" value="@title"/> <input type="text" style="width: 680px;" id="edit-title" value="@title"/>
<textarea style="width: 680px; height: 100px; max-height: 300px;" id="edit-content">@content.getOrElse("")</textarea> <textarea style="width: 680px; height: 100px; max-height: 300px;" id="edit-content">@content.getOrElse("")</textarea>
<div> <div>
<button type="button" class="btn btn-small">Update Issue</button> <input type="button" id="update" class="btn btn-small" value="Update Issue"/>
<button type="button" class="btn btn-small btn-danger pull-right">Cancel</button> <input type="button" id="cancel" class="btn btn-small btn-danger pull-right" value="Cancel"/>
</div> </div>
<script> <script>
$(function(){ $(function(){
@@ -16,7 +16,7 @@ $(function(){
$('#issueContent').empty().html(data.content); $('#issueContent').empty().html(data.content);
}; };
$('#issueContent input.btn').click(function(){ $('#update').click(function(){
$.ajax({ $.ajax({
url: '@path/@owner/@repository/issues/edit/@issueId', url: '@path/@owner/@repository/issues/edit/@issueId',
type: 'POST', type: 'POST',
@@ -31,7 +31,7 @@ $(function(){
}); });
}); });
$('#issueContent a.btn').click(function(){ $('#cancel').click(function(){
$.get('@path/@owner/@repository/issues/_data/@issueId', callback); $.get('@path/@owner/@repository/issues/_data/@issueId', callback);
return false; return false;
}); });