1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00
phorge-phorge/webroot/rsrc/js/application/differential/behavior-add-reviewers.js
2011-02-04 22:45:42 -08:00

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));
}
});
});