Example #1
0
 /**
  * Goes to the server to get array of remote issue link types.
  *
  * @return jQuery.Promise<Array>
  */
 function getRemoteIssueLinks (issueId) {
     var deferred = jQuery.Deferred();
     SmartAjax.makeRequest({
         url: contextPath + "/rest/viewIssue/1/remoteIssueLink/linkType?issueId=" + issueId,
         complete: function (xhr, textStatus, smartAjaxResult) {
             if (smartAjaxResult.successful) {
                 deferred.resolve(smartAjaxResult.data);
             } else {
                 deferred.reject(SmartAjax.buildDialogErrorContent(smartAjaxResult));
             }
         }
     });
     
     return deferred.promise();
 }
Example #2
0
    /**
     * Loads tab content using the active trigger's (<a> clicked) href as the url to request
     *
     * @param {Dialog} dialog
     * @return jQuery.Promise<String>
     */
    function getTabContent (dialog) {

        var deferred = jQuery.Deferred(),
            ajaxOptions = DialogUtil.getDefaultAjaxOptions.call(dialog);

        ajaxOptions.complete = function (xhr, textStatus, smartAjaxResult) {
            if (smartAjaxResult.successful) {
                deferred.resolve(smartAjaxResult.data);
            } else {
                deferred.reject(SmartAjax.buildDialogErrorContent(smartAjaxResult));
            }
        };

        SmartAjax.makeRequest(ajaxOptions);

        return deferred.promise();
    }