mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-31 06:16:51 -04:00
Add generic button component
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
name: 'button',
|
||||
template: require('../../templates/components/button.tpl'),
|
||||
style: require('../../styles/clay/components/button.scss'),
|
||||
manipulator: 'button',
|
||||
defaults: {
|
||||
primary: false,
|
||||
attributes: {},
|
||||
description: ''
|
||||
}
|
||||
};
|
||||
@@ -10,5 +10,6 @@ module.exports = {
|
||||
text: require('./text'),
|
||||
toggle: require('./toggle'),
|
||||
radiogroup: require('./radiogroup'),
|
||||
checkboxgroup: require('./checkboxgroup')
|
||||
checkboxgroup: require('./checkboxgroup'),
|
||||
button: require('./button')
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = {
|
||||
name: 'submit',
|
||||
template: require('../../templates/components/submit.tpl'),
|
||||
style: require('../../styles/clay/components/submit.scss'),
|
||||
manipulator: 'html',
|
||||
manipulator: 'button',
|
||||
defaults: {
|
||||
attributes: {}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,19 @@ module.exports = {
|
||||
hide: hide,
|
||||
show: show
|
||||
},
|
||||
button: {
|
||||
get: function() {
|
||||
return this.$manipulatorTarget.get('innerHTML');
|
||||
},
|
||||
set: function(value) {
|
||||
this.$manipulatorTarget.set('innerHTML', value);
|
||||
return this.trigger('change');
|
||||
},
|
||||
disable: disable,
|
||||
enable: enable,
|
||||
hide: hide,
|
||||
show: show
|
||||
},
|
||||
val: {
|
||||
get: function() {
|
||||
return this.$manipulatorTarget.get('value');
|
||||
|
||||
Reference in New Issue
Block a user