Created
May 16, 2016 10:59
-
-
Save garyjoy/208e274da9dfee221c929777f05795ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('View Event Handler for Feedback for HHS'); | |
var feedbackId = "#" + this.context.viewid + "_div"; | |
var feedbackDiv = $("#" + this.context.viewid + "_div"); | |
var feedbackTextId = "#" + this.context.viewid + "_text"; | |
$('img', this.context.element).attr("src", com_ibm_bpm_coach.getManagedAssetUrl("feedback.png", com_ibm_bpm_coach.assetType_WEB)); | |
// $('textarea', this.context.element).attr("rows", 5); | |
// $('textarea', this.context.element).attr("columns", 200); | |
var openScript = "$(\"" + feedbackId + "\").dialog(\"open\");"; | |
var closeScript = "$(\"" + feedbackId + "\").dialog(\"close\");"; | |
$('img', this.context.element).attr("onclick", openScript); | |
var _context = this.context; | |
$('button', this.context.element).click(function() { | |
_context.options.LogFeedback({ | |
params: { | |
'feedback': $(feedbackTextId).val() | |
}, | |
load: function(outputs) { | |
console.log("Feedback Sent") | |
$(feedbackId).dialog("close") | |
}, | |
error: function(error) { | |
console.log("Error Sending Feedback", error) | |
} | |
}) | |
}); | |
feedbackDiv.dialog({ | |
autoOpen: false, | |
modal: true, | |
width: "50%", | |
maxWidth: "90%", | |
title: "Feedback", | |
close: $.proxy(function(event, ui) {closeScript}, this) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment