mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 15:22:41 +01:00
31 lines
727 B
JavaScript
31 lines
727 B
JavaScript
/**
|
|
* @provides javelin-behavior-differential-add-reviewers
|
|
* @requires javelin-lib-dev
|
|
*/
|
|
|
|
JX.behavior('differential-add-reviewers', function(config) {
|
|
|
|
var root = JX.$(config.tokenizer);
|
|
var datasource = new JX.TypeaheadPreloadedSource(config.src);
|
|
|
|
var typeahead = new JX.Typeahead(root);
|
|
typeahead.setDatasource(datasource);
|
|
|
|
var tokenizer = new JX.Tokenizer(root);
|
|
tokenizer.setTypeahead(typeahead);
|
|
tokenizer.start();
|
|
|
|
JX.DOM.listen(
|
|
JX.$(config.select),
|
|
'change',
|
|
null,
|
|
function(e) {
|
|
if (JX.$(config.select).value == 'add_reviewers') {
|
|
JX.DOM.show(JX.$(config.row));
|
|
tokenizer.refresh();
|
|
} else {
|
|
JX.DOM.hide(JX.$(config.row));
|
|
}
|
|
});
|
|
});
|
|
|