1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00
phorge-phorge/webroot/rsrc/js/application/maniphest/behavior-task-preview.js

30 lines
723 B
JavaScript
Raw Normal View History

/**
* @provides javelin-behavior-maniphest-description-preview
* @requires javelin-behavior
* javelin-dom
* javelin-util
* phabricator-shaped-request
*/
JX.behavior('maniphest-description-preview', function(config) {
var preview = JX.$(config.preview);
var textarea = JX.$(config.textarea);
var callback = function(r) {
JX.DOM.setContent(JX.$(config.preview), JX.$H(r));
};
var getdata = function() {
return {
description : textarea.value
};
}
var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata);
var trigger = JX.bind(request, request.trigger);
JX.DOM.listen(textarea, 'keydown', null, trigger);
request.start();
});