mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
32 lines
727 B
JavaScript
32 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));
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|