mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-29 05:16:32 -04:00
Merge remote-tracking branch 'origin/master' into #11/description-for-input-components
# Conflicts: # dist/clay.js # src/styles/clay/_base.scss # src/templates/components/select.tpl # src/templates/components/toggle.tpl
This commit is contained in:
@@ -16,8 +16,10 @@ module.exports = {
|
||||
|
||||
var $value = self.$element.select('.value');
|
||||
|
||||
self.on('change', function(ev) {
|
||||
var value = self.$manipulatorTarget.select('option:checked').get('innerHTML');
|
||||
self.on('change', function() {
|
||||
var selectedIndex = self.$manipulatorTarget.get('selectedIndex');
|
||||
var $options = self.$manipulatorTarget.select('option');
|
||||
var value = $options[selectedIndex] && $options[selectedIndex].innerHTML;
|
||||
$value.set('innerHTML', value);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
module.exports = {
|
||||
name: 'submit',
|
||||
template: require('../../templates/components/submit.tpl'),
|
||||
style: require('../../styles/clay/components/submit.scss'),
|
||||
manipulator: 'html',
|
||||
defaults: {
|
||||
attributes: {}
|
||||
|
||||
@@ -11,6 +11,7 @@ var settings = _.extend({}, window.claySettings || {});
|
||||
var returnTo = window.returnTo || 'pebblejs://close#';
|
||||
var customFn = window.customFn || function() {};
|
||||
var clayComponents = window.clayComponents || {};
|
||||
var clayMeta = window.clayMeta || {};
|
||||
|
||||
var platform = window.navigator.userAgent.match(/android/i) ? 'android' : 'ios';
|
||||
document.documentElement.classList.add('platform-' + platform);
|
||||
@@ -21,7 +22,7 @@ _.eachObj(clayComponents, function(key, component) {
|
||||
});
|
||||
|
||||
var $mainForm = $('#main-form');
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm);
|
||||
var clayConfig = new ClayConfig(settings, config, $mainForm, clayMeta);
|
||||
|
||||
// add listeners here
|
||||
$mainForm.on('submit', function() {
|
||||
|
||||
@@ -26,9 +26,10 @@ var manipulators = require('./manipulators');
|
||||
* @param {Object} settings - setting that were set from a previous session
|
||||
* @param {Array|Object} config
|
||||
* @param {M} $rootContainer
|
||||
* @param {Object} meta
|
||||
* @constructor
|
||||
*/
|
||||
function ClayConfig(settings, config, $rootContainer) {
|
||||
function ClayConfig(settings, config, $rootContainer, meta) {
|
||||
var self = this;
|
||||
|
||||
var _settings = _.copyObj(settings);
|
||||
@@ -95,6 +96,8 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
self.meta = meta;
|
||||
|
||||
self.EVENTS = {
|
||||
/**
|
||||
* Called before framework has initialized. This is when you would attach your
|
||||
@@ -183,7 +186,6 @@ function ClayConfig(settings, config, $rootContainer) {
|
||||
|
||||
// expose the config to allow developers to update it before the build is run
|
||||
self.config = config;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user