1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 09:20:58 +01:00
phorge-phorge/webroot/rsrc/js/application/differential/behavior-add-reviewers.js

36 lines
863 B
JavaScript
Raw Normal View History

2011-02-05 07:45:42 +01:00
/**
* @provides javelin-behavior-differential-add-reviewers
* @requires javelin-behavior
* javelin-dom
* javelin-tokenizer
* javelin-typeahead
* javelin-typeahead-preloaded-source
2011-02-05 07:45:42 +01:00
*/
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));
}
});
});