Skip to content

Instantly share code, notes, and snippets.

@tbrd
Last active August 29, 2015 13:56
Show Gist options
  • Save tbrd/8972294 to your computer and use it in GitHub Desktop.
Save tbrd/8972294 to your computer and use it in GitHub Desktop.
Keyword string processor
define(function (require) {
'use strict';
/**
* Module dependencies
*/
var defineComponent = require('flight/lib/component');
/**
* Module exports
*/
return defineComponent(keywordProcessor);
/**
* Module function
*/
function keywordProcessor() {
this.defaultAttrs({
});
this.after('initialize', function () {
this.on('ui-keywords', this.handleKeywordChange);
});
this.handleKeywordChange = function (event, data) {
var keywords = data.keywords.split(' ');
this.trigger('data-keywords', {
keywords: keywords
});
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment