X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/536b189c1a7173b2ea5f5ba16387ec904a7ce40e..fef7f24f34c07be9d9aff6db434e997f9a1f3451:/project/static/js/editor.ui.js diff --git a/project/static/js/editor.ui.js b/project/static/js/editor.ui.js index aed04553..4d2a5d39 100755 --- a/project/static/js/editor.ui.js +++ b/project/static/js/editor.ui.js @@ -163,15 +163,17 @@ Editor.prototype.setupUI = function() { $('#commit-dialog'). jqm({ modal: true, + onShow: $.fbind(self, self.loadRelatedIssues), trigger: '#toolbar-button-commit' }); - + + /* STATIC BINDS */ $('#commit-dialog-cancel-button').click(function() { $('#commit-dialog-error-empty-message').hide(); $('#commit-dialog').jqmHide(); }); - $('#commit-dialog-save-button').click( function (event, data) + $('#commit-dialog-save-button').click( function (event, data) { if( $('#commit-dialog-message').val().match(/^\s*$/)) { $('#commit-dialog-error-empty-message').fadeIn(); @@ -180,10 +182,11 @@ Editor.prototype.setupUI = function() { $('#commit-dialog-error-empty-message').hide(); $('#commit-dialog').jqmHide(); self.sendMergeRequest($('#commit-dialog-message').val() ); - } - + } + return false; - }); + }); + /* SPLIT DIALOG */ $('#split-dialog').jqm({ @@ -195,6 +198,31 @@ Editor.prototype.setupUI = function() { // $('#split-dialog'). } +Editor.prototype.loadRelatedIssues = function(hash) +{ + var self = this; + var c = $('#commit-dialog-related-issues'); + + $("div.loading-box", c).show(); + $("div.fatal-error-box", c).hide(); + $("div.container-box", c).hide(); + + $.getJSON( c.attr('ui:ajax-src') + '?callback=?', + function(data, status) + { + var fmt = ''; + $(data).each( function() { + fmt += '\n' + }); + $("div.container-box", c).html(fmt); + $("div.loading-box", c).hide(); + $("div.container-box", c).show(); + }); + + hash.w.show(); +} + Editor.prototype.loadSplitDialog = function(hash) { var self = this;