Created
November 5, 2014 21:26
-
-
Save mattmontgomery/3cdd38cd67b5b6bb8329 to your computer and use it in GitHub Desktop.
Augmenting search select for resourceMethod and resourceData
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(function(require) { | |
| var $ = require('jQuery'), | |
| _ = require('Underscore'), | |
| Backbone = require('Backbone'), | |
| Tile = require('Tile'), | |
| Flexer = require('tile!layouts/flexer'), | |
| Dropdown = require('tile!cmslayouts/dropdown-input'), | |
| CMSCollection = require('cmshelpers/collection'), | |
| Dropzone = require('tile!cmslayouts/dropzone'), | |
| KeyNavigator = require('keynavigator'); | |
| return Dropzone.extend({ | |
| optionSchema: Dropzone.prototype.optionSchema.extend({ | |
| resourceMethod: { | |
| filter: 'options', | |
| defaultValue: 'url' | |
| }, | |
| resourceUrl: { | |
| filter: 'string', | |
| flowFlags: Tile.FLOW_LOCAL, | |
| flowJob: Tile.JOB_RENDER, | |
| defaultValue: '' | |
| }, | |
| resourceData: { | |
| filter: 'array', | |
| flowFlags: Tile.FLOW_LOCAL, | |
| flowJob: Tile.JOB_RENDER, | |
| defaultValue: [] | |
| }, | |
| },{}), | |
| search: function(ev) { | |
| ev.preventDefault(); | |
| var self = this, | |
| timers = this.options.timers; | |
| if(this.options.resourceMethod === 'url') { | |
| // existing logic | |
| } else { | |
| // new logic | |
| } | |
| }, | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment