Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/qui
1 Ergebnis
Änderungen anzeigen
werden angezeigt mit 1256 Ergänzungen und 1202 Löschungen
......@@ -30,13 +30,13 @@ var needle = [
'qui/controls/contextmenu/Item'
];
if (!("QUI" in window) || !window.QUI.getAttribute('control-buttons-dont-load-css')) {
if (!('QUI' in window) || !window.QUI.getAttribute('control-buttons-dont-load-css')) {
needle.push('css!qui/controls/buttons/Button.css');
}
define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect, ContextMenuItem) {
"use strict";
define('qui/controls/buttons/Button', needle, function(Control, Utils, NoSelect, ContextMenuItem) {
'use strict';
/**
* @class qui/controls/buttons/Button
......@@ -64,35 +64,35 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
return new Class({
Extends: Control,
Type : 'qui/controls/buttons/Button',
Type: 'qui/controls/buttons/Button',
Binds: [
'onSetAttribute'
],
options: {
'type' : 'button',
'image' : false, // (@depricated) use the icon attribute
'icon' : false, // icon top of the text
'style' : {}, // mootools css style attributes
'textimage' : false, // Image left from text
'text' : false, // Button text
'title' : false,
'class' : false, // extra CSS Class
'type': 'button',
'image': false, // (@depricated) use the icon attribute
'icon': false, // icon top of the text
'style': {}, // mootools css style attributes
'textimage': false, // Image left from text
'text': false, // Button text
'title': false,
'class': false, // extra CSS Class
'buttonCSSClass': true, // should have the button the qui-button css class?
'menuCorner' : 'top',
'dropDownIcon' : true
'menuCorner': 'top',
'dropDownIcon': true
},
params: {},
initialize: function (options) {
initialize: function(options) {
options = options || {};
this.parent(options);
this.$Menu = null;
this.$Drop = null;
this.$Menu = null;
this.$Drop = null;
this.$items = [];
......@@ -105,7 +105,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
);
this.addEvent('onSetAttribute', this.onSetAttribute);
this.addEvent('onDestroy', function () {
this.addEvent('onDestroy', function() {
if (this.$Menu) {
this.$Menu.destroy();
}
......@@ -119,10 +119,10 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @param {Object} options
* @ignore
*/
initV2: function (options) {
initV2: function(options) {
if (typeof options.onclick !== 'undefined') {
if (typeOf(options.onclick) === 'string') {
options.onclick = function (p) {
options.onclick = function(p) {
eval(p + '(this);');
}.bind(this, [options.onclick]);
}
......@@ -145,13 +145,13 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#create
* @return {HTMLElement}
*/
create: function () {
create: function() {
var self = this;
var Elm = new Element('button', {
'type' : this.getAttribute('type'),
'type': this.getAttribute('type'),
'data-status': 0,
'data-quiid' : this.getId()
'data-quiid': this.getId()
});
Elm.addClass('qui-button--no-icon');
......@@ -177,11 +177,11 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
}
Elm.style.outline = 0;
Elm.setAttribute('tabindex', "-1");
Elm.setAttribute('tabindex', '-1');
Elm.addEvents({
click: function (event) {
click: function(event) {
if (self.isDisabled()) {
return;
}
......@@ -189,7 +189,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
self.onclick(event);
},
mouseenter: function () {
mouseenter: function() {
if (self.isDisabled()) {
return;
}
......@@ -201,7 +201,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
self.fireEvent('enter', [self]);
},
mouseleave: function () {
mouseleave: function() {
if (self.isDisabled()) {
return;
}
......@@ -210,7 +210,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
self.fireEvent('leave', [self]);
},
mousedown: function (event) {
mousedown: function(event) {
if (self.isDisabled()) {
return;
}
......@@ -219,7 +219,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
},
mouseup: function (event) {
mouseup: function(event) {
if (self.isDisabled()) {
return;
}
......@@ -227,11 +227,11 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
self.fireEvent('mouseup', [self, event]);
},
blur: function (event) {
blur: function(event) {
self.fireEvent('blur', [self, event]);
},
focus: function (event) {
focus: function(event) {
self.fireEvent('focus', [self, event]);
}
});
......@@ -278,7 +278,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
var len = this.$items.length;
if (len) {
this.getContextMenu(function (Menu) {
this.getContextMenu(function(Menu) {
for (i = 0; i < len; i++) {
Menu.appendChild(self.$items[i]);
}
......@@ -304,7 +304,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#onclick
* @param {DOMEvent} event
*/
click: function (event) {
click: function(event) {
if (this.isDisabled()) {
return;
}
......@@ -320,7 +320,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
/**
* @see #click()
*/
onclick: function (event) {
onclick: function(event) {
this.click(event);
},
......@@ -329,7 +329,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
*
* @method qui/controls/buttons/Button#setActive
*/
setActive: function () {
setActive: function() {
if (this.isDisabled()) {
return;
}
......@@ -352,7 +352,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#isActive
* @return {Boolean}
*/
isActive: function () {
isActive: function() {
if (!this.getElm()) {
return false;
}
......@@ -367,7 +367,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#disable
* @return {Object} this (qui/controls/buttons/Button)
*/
disable: function () {
disable: function() {
var Elm = this.getElm();
if (!Elm) {
......@@ -376,7 +376,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
Elm.set({
'data-status': -1,
'disabled' : 'disabled'
'disabled': 'disabled'
});
this.fireEvent('disable', [this]);
......@@ -389,7 +389,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#setDisable
* @return {Object} this (qui/controls/buttons/Button)
*/
setDisable: function () {
setDisable: function() {
return this.disable();
},
......@@ -399,7 +399,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#isDisabled
* @return {Boolean}
*/
isDisabled: function () {
isDisabled: function() {
if (!this.getElm()) {
return false;
}
......@@ -413,14 +413,14 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#setEnable
* @return {Object} this (qui/controls/buttons/Button)
*/
enable: function () {
enable: function() {
if (!this.getElm()) {
return this;
}
this.getElm().set({
'data-status': 0,
'disabled' : null
'disabled': null
});
this.fireEvent('enable', [this]);
......@@ -435,7 +435,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#setEnable
* @return {Object} this (qui/controls/buttons/Button)
*/
setEnable: function () {
setEnable: function() {
return this.enable();
},
......@@ -446,7 +446,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#setNormal
* @return {Object} this (qui/controls/buttons/Button)
*/
setNormal: function () {
setNormal: function() {
if (this.isDisabled()) {
return this;
}
......@@ -459,7 +459,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
Elm.set({
'data-status': 0,
'disabled' : null
'disabled': null
});
Elm.removeClass('qui-button-active');
......@@ -478,7 +478,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @param {Object} Itm - qui/controls/contextmenu/Item | object
* @return {Object} this (qui/controls/buttons/Button)
*/
appendChild: function (Itm) {
appendChild: function(Itm) {
if (typeOf(Itm) === 'object') {
Itm = new ContextMenuItem(Itm);
}
......@@ -493,10 +493,10 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
var self = this;
this.getContextMenu(function (Menu) {
this.getContextMenu(function(Menu) {
Menu.appendChild(Itm);
Itm.addEvent('click', function (Itm) {
Itm.addEvent('click', function(Itm) {
self.fireEvent('change', [self, Itm]);
});
......@@ -516,7 +516,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#getChildren
* @return {Array}
*/
getChildren: function () {
getChildren: function() {
return this.$items;
},
......@@ -526,8 +526,8 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @method qui/controls/buttons/Button#clear
* @return {Object} this (qui/controls/buttons/Button)
*/
clear: function () {
this.getContextMenu(function (Menu) {
clear: function() {
this.getContextMenu(function(Menu) {
Menu.clearChildren();
});
......@@ -544,7 +544,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
* @param {Function} callback - callback function( {qui/controls/contextmenu/Menu} )
* @return {Object} this (qui/controls/buttons/Button)
*/
getContextMenu: function (callback) {
getContextMenu: function(callback) {
if (this.$Menu && typeof this.$createContextMenu === 'undefined') {
callback(this.$Menu);
return this;
......@@ -553,7 +553,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
var self = this;
if (typeof this.$createContextMenu !== 'undefined') {
(function () {
(function() {
self.getContextMenu(callback);
}).delay(10);
......@@ -563,24 +563,46 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
this.$createContextMenu = true;
require(['qui/controls/contextmenu/Menu'], function (Menu) {
require(['qui/controls/contextmenu/Menu'], function(Menu) {
self.$Menu = new Menu({
name : self.getAttribute('name') + '-menu',
name: self.getAttribute('name') + '-menu',
corner: self.getAttribute('menuCorner')
});
self.$Menu.setParent(self);
self.$Menu.inject(document.body);
self.addEvents({
onClick: function () {
onClick: function(Instance, event) {
if (self.isDisabled()) {
return;
}
var pos = self.$Elm.getPosition(),
size = self.$Elm.getSize(),
if (typeof event === 'object') {
event.stop();
let triggerNode = event.target;
if (triggerNode.nodeName !== 'BUTTON') {
triggerNode = triggerNode.getParent('button');
}
mpos = self.getAttribute('menuCorner'),
if (triggerNode.nodeName !== 'BUTTON') {
return;
}
if (triggerNode !== self.$Elm) {
return;
}
} else {
if (typeof Instance.getElm === 'function' && self.$Elm !== Instance.getElm()) {
return;
}
}
var pos = self.$Elm.getPosition(),
size = self.$Elm.getSize(),
mpos = self.getAttribute('menuCorner'),
msize = self.$Menu.getElm().getComputedSize();
if (mpos.contains('bottom')) {
......@@ -599,7 +621,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
self.$Elm.focus();
},
onBlur: function () {
onBlur: function() {
self.$Menu.hide();
}
});
......@@ -622,7 +644,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
*
* @ignore
*/
onSetAttribute: function (k, value) {
onSetAttribute: function(k, value) {
var Elm = this.getElm();
//this.options[k] = value;
......@@ -635,7 +657,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
if (k === 'onclick') {
this.removeEvents('click');
this.addEvent('click', function (p) {
this.addEvent('click', function(p) {
eval(p + '(this);');
}.bind(this, [value]));
......@@ -664,7 +686,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
}).inject(Image);
} else {
new Element('img.qui-button-image', {
src : value,
src: value,
styles: {
'display': 'block' // only image, fix
}
......@@ -675,13 +697,13 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
}
// Style Attributes
if (k === "styles") {
if (k === 'styles') {
Elm.setStyles(value);
return;
}
// Text
if (k === "title") {
if (k === 'title') {
Elm.set('title', value);
return;
}
......@@ -721,7 +743,7 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
Img = new Element('span', {
'class': 'qui-button-text-image ' + value,
styles : {
styles: {
'margin-right': 0
}
}).inject(Txt, 'before');
......@@ -732,8 +754,8 @@ define('qui/controls/buttons/Button', needle, function (Control, Utils, NoSelect
Img = new Element('img', {
'class': 'qui-button-text-image',
src : value,
styles : {
src: value,
styles: {
'margin-right': 0
}
}).inject(Txt, 'before');
......
......@@ -12,27 +12,27 @@ define('qui/controls/buttons/ButtonMultiple', [
'css!qui/controls/buttons/ButtonMultiple.css'
], function (QUI, QUIControl, NoSelect, ControlUtils, QUIContextMenuItem) {
"use strict";
], function(QUI, QUIControl, NoSelect, ControlUtils, QUIContextMenuItem) {
'use strict';
return new Class({
Extends: QUIControl,
Type : 'qui/controls/buttons/ButtonMultiple',
Type: 'qui/controls/buttons/ButtonMultiple',
Binds: [
'$onSetAttribute'
],
options: {
disabled : false,
disabled: false,
textimage: false, // Image left from text
text : false, // Button text
title : false,
class : false // extra CSS Class
text: false, // Button text
title: false,
class: false // extra CSS Class
},
initialize: function (options) {
initialize: function(options) {
this.parent(options);
this.$Menu = null;
......@@ -53,19 +53,19 @@ define('qui/controls/buttons/ButtonMultiple', [
*
* @returns {HTMLDivElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('div', {
'class' : 'qui-button-multiple',
'class': 'qui-button-multiple',
'data-quiid': this.getId(),
html : '<button></button>' +
'<div class="qui-button-multiple-dd">' +
' <div class="qui-button-multiple-dd-line"></div>' +
' <span class="fa fa-angle-down"></span>' +
'</div>'
html: '<button></button>' +
'<div class="qui-button-multiple-dd">' +
' <div class="qui-button-multiple-dd-line"></div>' +
' <span class="fa fa-angle-down"></span>' +
'</div>'
});
this.$Elm.style.outline = 0;
this.$Elm.setAttribute('tabindex', "-1");
this.$Elm.setAttribute('tabindex', '-1');
// nodes
this.$Button = this.$Elm.getElement('button');
......@@ -80,7 +80,7 @@ define('qui/controls/buttons/ButtonMultiple', [
}).inject(this.$Button);
this.$Button.style.outline = 0;
this.$Button.setAttribute('tabindex', "-1");
this.$Button.setAttribute('tabindex', '-1');
// data
if (this.getAttribute('styles')) {
......@@ -108,12 +108,12 @@ define('qui/controls/buttons/ButtonMultiple', [
}
// menu
this.$DropDownContainer.addEvent('click', function () {
this.$DropDownContainer.addEvent('click', function() {
this.openMenu();
}.bind(this));
if (this.$items.length) {
this.getMenu().then(function (Menu) {
this.getMenu().then(function(Menu) {
var len = this.$items.length;
for (var i = 0; i < len; i++) {
......@@ -124,7 +124,7 @@ define('qui/controls/buttons/ButtonMultiple', [
// events
this.$Elm.addEvents({
blur: function () {
blur: function() {
/*this.getMenu().then(function (Menu) {
Menu.hide();
}.bind(this));*/
......@@ -132,7 +132,7 @@ define('qui/controls/buttons/ButtonMultiple', [
});
this.$Button.addEvents({
click: function (event) {
click: function(event) {
if (this.isDisabled()) {
return;
}
......@@ -154,7 +154,7 @@ define('qui/controls/buttons/ButtonMultiple', [
*
* @param {DOMEvent} event
*/
click: function (event) {
click: function(event) {
if (this.isDisabled()) {
return;
}
......@@ -173,7 +173,7 @@ define('qui/controls/buttons/ButtonMultiple', [
* Disable the Button
* Most Events are no more triggered
*/
disable: function () {
disable: function() {
if (!this.$Elm) {
return this;
}
......@@ -188,7 +188,7 @@ define('qui/controls/buttons/ButtonMultiple', [
/**
* Enable the Button
*/
enable: function () {
enable: function() {
if (!this.$Elm) {
return this;
}
......@@ -205,7 +205,7 @@ define('qui/controls/buttons/ButtonMultiple', [
*
* @returns {Boolean}
*/
isDisabled: function () {
isDisabled: function() {
return this.$disabled;
},
......@@ -217,8 +217,8 @@ define('qui/controls/buttons/ButtonMultiple', [
* @param {Object} Itm - qui/controls/contextmenu/Item | object
* @return {Promise}
*/
appendChild: function (Itm) {
if (typeOf(Itm) == 'object') {
appendChild: function(Itm) {
if (typeOf(Itm) === 'object') {
Itm = new QUIContextMenuItem(Itm);
}
......@@ -230,7 +230,7 @@ define('qui/controls/buttons/ButtonMultiple', [
return Promise.resolve();
}
return this.getMenu().then(function (Menu) {
return this.getMenu().then(function(Menu) {
Menu.appendChild(Itm);
});
},
......@@ -241,7 +241,7 @@ define('qui/controls/buttons/ButtonMultiple', [
* @method qui/controls/buttons/Button#getChildren
* @return {Array}
*/
getChildren: function () {
getChildren: function() {
return this.$items;
},
......@@ -250,10 +250,10 @@ define('qui/controls/buttons/ButtonMultiple', [
*
* @return {Promise}
*/
clear: function () {
clear: function() {
this.$items = [];
return this.getMenu().then(function (Menu) {
return this.getMenu().then(function(Menu) {
Menu.clearChildren();
});
},
......@@ -263,7 +263,7 @@ define('qui/controls/buttons/ButtonMultiple', [
*
* @return {Promise}
*/
getMenu: function () {
getMenu: function() {
if (this.$Menu) {
return Promise.resolve(this.$Menu);
}
......@@ -271,15 +271,16 @@ define('qui/controls/buttons/ButtonMultiple', [
return new Promise((resolve) => {
require(['qui/controls/contextmenu/Menu'], (Menu) => {
this.$Menu = new Menu({
name : this.getAttribute('name') + '-menu',
name: this.getAttribute('name') + '-menu',
corner: 'top'
});
this.$Menu.addEvent('blur', () => {
this.$Menu.hide();
});
this.$Menu.inject(document.body);
this.$Menu.setParent(this);
this.$Menu.inject(document.body);
resolve(this.$Menu);
});
......@@ -326,13 +327,13 @@ define('qui/controls/buttons/ButtonMultiple', [
*
* @return {Promise}
*/
openMenu: function () {
openMenu: function() {
if (this.isDisabled()) {
return Promise.resolve();
}
return this.getMenu().then(function (Menu) {
var pos = this.$Elm.getPosition(),
return this.getMenu().then(function(Menu) {
var pos = this.$Elm.getPosition(),
size = this.$Elm.getSize();
Menu.setPosition(
......@@ -350,7 +351,7 @@ define('qui/controls/buttons/ButtonMultiple', [
* @param attribute
* @param value
*/
$onSetAttribute: function (attribute, value) {
$onSetAttribute: function(attribute, value) {
if (!this.$Elm) {
return;
}
......
......@@ -17,12 +17,12 @@ define('qui/controls/buttons/ButtonSwitch', [
'css!qui/controls/buttons/ButtonSwitch.css'
], function (QUI, QUIControl, QUISwitch) {
"use strict";
], function(QUI, QUIControl, QUISwitch) {
'use strict';
return new Class({
Extends: QUIControl,
Type : 'qui/controls/buttons/ButtonSwitch',
Type: 'qui/controls/buttons/ButtonSwitch',
Binds: [
'$onInject',
......@@ -31,23 +31,23 @@ define('qui/controls/buttons/ButtonSwitch', [
],
options: {
status : 0,
text : false, // Button text
title : false,
styles : false,
status: 0,
text: false, // Button text
title: false,
styles: false,
disabled: false
},
initialize: function (options) {
initialize: function(options) {
this.parent(options);
this.$Switch = null;
this.$Switch = null;
this.$disabled = this.getAttribute('disabled');
this.addEvents({
onInject : this.$onInject,
onInject: this.$onInject,
onSetAttribute: this.$onSetAttribute,
onDestroy : function () {
onDestroy: function() {
if (this.$Switch) {
this.$Switch.destroy();
}
......@@ -60,12 +60,12 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @returns {HTMLDivElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('button', {
'class': 'qui-button-switch',
html : '<div class="qui-button-switch-switch"></div>' +
'<div class="qui-button-switch-text"></div>' +
'<div class="qui-button-switch--click"></div>'
html: '<div class="qui-button-switch-switch"></div>' +
'<div class="qui-button-switch-text"></div>' +
'<div class="qui-button-switch--click"></div>'
});
this.$Text = this.$Elm.getElement('.qui-button-switch-text');
......@@ -95,7 +95,7 @@ define('qui/controls/buttons/ButtonSwitch', [
/**
* Event : on inject
*/
$onInject: function () {
$onInject: function() {
if (this.getAttribute('status')) {
this.$Switch.on();
} else {
......@@ -110,7 +110,7 @@ define('qui/controls/buttons/ButtonSwitch', [
/**
* Refresh the display / rendering - on / off button
*/
resize: function () {
resize: function() {
if (this.$Switch) {
this.$Switch.resize();
}
......@@ -121,7 +121,7 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @param {Event} [event] - click event
*/
toggle: function (event) {
toggle: function(event) {
if (this.$disabled) {
return;
}
......@@ -139,7 +139,7 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @return {Promise}
*/
on: function () {
on: function() {
if (this.$disabled) {
return Promise.resolve();
}
......@@ -148,7 +148,7 @@ define('qui/controls/buttons/ButtonSwitch', [
return Promise.resolve();
}
this.$Switch.on().then(function () {
this.$Switch.on().then(function() {
this.fireEvent('change', [this]);
}.bind(this));
},
......@@ -158,7 +158,7 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @return {Promise}
*/
off: function () {
off: function() {
if (this.$disabled) {
return Promise.resolve();
}
......@@ -167,7 +167,7 @@ define('qui/controls/buttons/ButtonSwitch', [
return Promise.resolve();
}
return this.$Switch.off().then(function () {
return this.$Switch.off().then(function() {
this.fireEvent('change', [this]);
}.bind(this));
},
......@@ -177,7 +177,7 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @returns {Promise}
*/
setSilentOn: function () {
setSilentOn: function() {
return this.$Switch.setSilentOn();
},
......@@ -186,7 +186,7 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @returns {Promise}
*/
setSilentOff: function () {
setSilentOff: function() {
return this.$Switch.setSilentOff();
},
......@@ -195,15 +195,15 @@ define('qui/controls/buttons/ButtonSwitch', [
*
* @return {Boolean}
*/
getStatus: function () {
getStatus: function() {
return this.$Switch.getStatus();
},
/**
* Enable the
*/
enable: function () {
this.$disabled = false;
enable: function() {
this.$disabled = false;
this.$Elm.disabled = false;
this.$Switch.enable();
},
......@@ -212,8 +212,8 @@ define('qui/controls/buttons/ButtonSwitch', [
* Disable the buttonswitch
* The button switch cant be changed
*/
disable: function () {
this.$disabled = true;
disable: function() {
this.$disabled = true;
this.$Elm.disabled = true;
this.$Switch.disable();
},
......@@ -224,18 +224,18 @@ define('qui/controls/buttons/ButtonSwitch', [
* @param {String} name
* @param value
*/
$onSetAttribute: function (name, value) {
if (name === "styles") {
$onSetAttribute: function(name, value) {
if (name === 'styles') {
this.$Elm.setStyles(value);
return;
}
if (name === "title") {
if (name === 'title') {
this.$Elm.set('title', value);
return;
}
if (name === "text") {
if (name === 'text') {
this.$Text.set('html', value);
}
}
......
Dieser Diff ist reduziert.
......@@ -13,8 +13,8 @@ define('qui/controls/buttons/Separator', [
'qui/controls/Control'
], function (Control) {
"use strict";
], function(Control) {
'use strict';
/**
* @class qui/controls/buttons/Separator
......@@ -25,18 +25,18 @@ define('qui/controls/buttons/Separator', [
return new Class({
Extends: Control,
Type : 'qui/controls/buttons/Separator',
Type: 'qui/controls/buttons/Separator',
options: {
height: false,
styles: false
},
initialize: function (options) {
initialize: function(options) {
this.parent(options);
// Events
this.addEvent('resize', function () {
this.addEvent('resize', function() {
var Elm = this.getElm();
if (Elm && Elm.getParent()) {
......@@ -51,7 +51,7 @@ define('qui/controls/buttons/Separator', [
* @method qui/controls/buttons/Separator#create
* @return {HTMLElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('div.qui-buttons-separator', {
'data-quiid': this.getId()
});
......
......@@ -17,13 +17,13 @@ define('qui/controls/buttons/Switch', [
'css!qui/controls/buttons/Switch.css'
], function (QUIControl) {
"use strict";
], function(QUIControl) {
'use strict';
return new Class({
Extends: QUIControl,
Type : 'qui/controls/buttons/Switch',
Type: 'qui/controls/buttons/Switch',
Binds: [
'toggle',
......@@ -32,33 +32,33 @@ define('qui/controls/buttons/Switch', [
],
options: {
name : '',
title : '',
name: '',
title: '',
styles: false,
status: true,
switchTextOn : '',
switchTextOnIcon : 'icon-ok fa fa-check',
switchTextOff : '',
switchTextOn: '',
switchTextOnIcon: 'icon-ok fa fa-check',
switchTextOff: '',
switchTextOffIcon: 'icon-remove fa fa-close'
},
initialize: function (options) {
initialize: function(options) {
this.parent(options);
this.$Button = false;
this.$FxElm = false;
this.$Button = false;
this.$FxElm = false;
this.$FxButton = false;
this.$loaded = false;
this.$status = this.getAttribute('status');
this.$loaded = false;
this.$status = this.getAttribute('status');
this.$triggerEvents = true;
this.$disabled = false;
this.$activeColor = '#0069b4';
this.$disabled = false;
this.$activeColor = '#0069b4';
this.addEvents({
onInject : this.$onInject,
onInject: this.$onInject,
onSetAttribute: this.$onSetAttribute
});
},
......@@ -68,18 +68,18 @@ define('qui/controls/buttons/Switch', [
*
* @return {Promise}
*/
resize: function () {
return new Promise(function (resolve) {
resize: function() {
return new Promise(function(resolve) {
this.$Button.setStyle('width', this.$ButtonTextOff.getSize().x);
var Prom = this.getStatus() ? this.setSilentOn() : this.setSilentOff();
Prom.then(function () {
Prom.then(function() {
moofx(this.$Elm).animate({
opacity: 1
}, {
callback: function () {
callback: function() {
this.$Elm.setStyle('opacity', null);
resolve();
}.bind(this)
......@@ -94,10 +94,10 @@ define('qui/controls/buttons/Switch', [
* @method qui/controls/buttons/Button#create
* @return {HTMLElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('div', {
'class' : 'qui-switch',
html : '<div class="qui-switch-off">' +
'class': 'qui-switch',
html: '<div class="qui-switch-off">' +
'<div class="qui-switch-icon-off"></div>' +
'<div class="qui-switch-text-off"></div>' +
'</div>' +
......@@ -107,23 +107,23 @@ define('qui/controls/buttons/Switch', [
'</div>' +
'<div class="qui-switch-button"></div>' +
'<input type="hidden" />',
styles : {
styles: {
background: this.$activeColor,
opacity : 0
opacity: 0
},
'data-quiid': this.getId()
});
this.$InputStatus = this.$Elm.getElement('input');
this.$Button = this.$Elm.getElement('.qui-switch-button');
this.$Button = this.$Elm.getElement('.qui-switch-button');
this.$ButtonTextOn = this.$Elm.getElement('.qui-switch-on');
this.$TextOn = this.$Elm.getElement('.qui-switch-text-on');
this.$TextOn = this.$Elm.getElement('.qui-switch-text-on');
this.$ButtonTextOff = this.$Elm.getElement('.qui-switch-off');
this.$TextOff = this.$Elm.getElement('.qui-switch-text-off');
this.$TextOff = this.$Elm.getElement('.qui-switch-text-off');
this.$IconOn = this.$Elm.getElement('.qui-switch-icon-on');
this.$IconOn = this.$Elm.getElement('.qui-switch-icon-on');
this.$IconOff = this.$Elm.getElement('.qui-switch-icon-off');
this.$IconOn.addClass(this.getAttribute('switchTextOnIcon'));
......@@ -141,14 +141,14 @@ define('qui/controls/buttons/Switch', [
if (this.getAttribute('switchTextOn') === '') {
this.$TextOn.setStyles({
textAlign: 'center',
width : '100%'
width: '100%'
});
}
if (this.getAttribute('switchTextOff') === '') {
this.$TextOff.setStyles({
textAlign: 'center',
width : '100%'
width: '100%'
});
}
......@@ -156,7 +156,7 @@ define('qui/controls/buttons/Switch', [
this.$Elm.set('title', this.getAttribute('title'));
}
this.$FxElm = moofx(this.$Elm);
this.$FxElm = moofx(this.$Elm);
this.$FxButton = moofx(this.$Button);
this.$InputStatus.set('name', this.getAttribute('name'));
......@@ -167,7 +167,7 @@ define('qui/controls/buttons/Switch', [
/**
* event : on inject
*/
$onInject: function () {
$onInject: function() {
var size = this.$Elm.getSize();
if (size.x === 0 && size.y === 0) {
......@@ -180,7 +180,7 @@ define('qui/controls/buttons/Switch', [
this.$Elm.setStyle('opacity', null);
var wasDisabled = this.$disabled,
lastCall = function () {
lastCall = function() {
if (wasDisabled) {
this.disable();
}
......@@ -203,7 +203,7 @@ define('qui/controls/buttons/Switch', [
*
* @returns {Boolean}
*/
getStatus: function () {
getStatus: function() {
return this.$status;
},
......@@ -212,7 +212,7 @@ define('qui/controls/buttons/Switch', [
*
* @return {Promise}
*/
toggle: function () {
toggle: function() {
if (this.$status) {
return this.off();
}
......@@ -226,7 +226,7 @@ define('qui/controls/buttons/Switch', [
* @param {Boolean} [noFX] - with or without effect - default = with effect
* @return {Promise}
*/
on: function (noFX) {
on: function(noFX) {
if (this.$disabled) {
return Promise.resolve();
}
......@@ -235,7 +235,7 @@ define('qui/controls/buttons/Switch', [
noFX = false;
}
this.$status = 1;
this.$status = 1;
this.$activeColor = '#0069b4';
this.$Elm.set('data-status', this.$status);
......@@ -252,7 +252,7 @@ define('qui/controls/buttons/Switch', [
return Promise.resolve();
}
return new Promise(function (resolve) {
return new Promise(function(resolve) {
// Send the "on" switch status
this.$InputStatus.addEvents('click', this.$InputStatus.set('value', '1'));
......@@ -262,7 +262,7 @@ define('qui/controls/buttons/Switch', [
});
this.$Button.setStyles({
left : 0,
left: 0,
width: this.$ButtonTextOff.getSize().x
});
......@@ -278,7 +278,7 @@ define('qui/controls/buttons/Switch', [
});
this.$FxButton.animate({
left : 0,
left: 0,
width: this.$ButtonTextOff.getSize().x
}, {
duration: 350,
......@@ -287,7 +287,7 @@ define('qui/controls/buttons/Switch', [
});
// just in case moofx does not call the callback
(function () {
(function() {
resolve();
}).delay(350);
}.bind(this));
......@@ -299,7 +299,7 @@ define('qui/controls/buttons/Switch', [
* @param {Boolean} [noFX] - with or without effect - default = with effect
* @return {Promise}
*/
off: function (noFX) {
off: function(noFX) {
if (this.$disabled) {
return Promise.resolve();
}
......@@ -308,7 +308,7 @@ define('qui/controls/buttons/Switch', [
noFX = false;
}
this.$status = 0;
this.$status = 0;
this.$activeColor = '#ffffff';
this.$Elm.set('data-status', this.$status);
......@@ -325,11 +325,11 @@ define('qui/controls/buttons/Switch', [
return Promise.resolve();
}
return new Promise(function (resolve) {
return new Promise(function(resolve) {
// Send the "off" switch status
this.$InputStatus.addEvents('click', this.$InputStatus.set('value', '0'));
var onWidth = this.$ButtonTextOn.getSize().x,
var onWidth = this.$ButtonTextOn.getSize().x,
offWidth = this.$ButtonTextOff.getSize().x;
if (noFX) {
......@@ -338,7 +338,7 @@ define('qui/controls/buttons/Switch', [
});
this.$Button.setStyles({
left : offWidth,
left: offWidth,
width: onWidth
});
......@@ -354,7 +354,7 @@ define('qui/controls/buttons/Switch', [
});
this.$FxButton.animate({
left : offWidth,
left: offWidth,
width: onWidth
}, {
duration: 350,
......@@ -363,7 +363,7 @@ define('qui/controls/buttons/Switch', [
});
// just in case moofx does not call the callback
(function () {
(function() {
resolve();
}).delay(350);
}.bind(this));
......@@ -375,10 +375,10 @@ define('qui/controls/buttons/Switch', [
* @param {Boolean} [noFX] - with or without effect - default = with effect
* @return {Promise}
*/
setSilentOn: function (noFX) {
setSilentOn: function(noFX) {
this.$triggerEvents = false;
return this.on(noFX).then(function () {
return this.on(noFX).then(function() {
this.$triggerEvents = true;
}.bind(this));
},
......@@ -389,10 +389,10 @@ define('qui/controls/buttons/Switch', [
* @param {Boolean} [noFX] - with or without effect - default = with effect
* @return {Promise}
*/
setSilentOff: function (noFX) {
setSilentOff: function(noFX) {
this.$triggerEvents = false;
return this.off(noFX).then(function () {
return this.off(noFX).then(function() {
this.$triggerEvents = true;
}.bind(this));
},
......@@ -400,8 +400,8 @@ define('qui/controls/buttons/Switch', [
/**
* Enables the Switch so that the status can be switched
*/
enable: function () {
this.$disabled = false;
enable: function() {
this.$disabled = false;
this.$activeColor = '#0069b4';
this.getElm().removeClass('qui-switch-button-disabled');
},
......@@ -409,8 +409,8 @@ define('qui/controls/buttons/Switch', [
/**
* Disables the Switch: No status change possible
*/
disable: function () {
this.$disabled = true;
disable: function() {
this.$disabled = true;
this.$activeColor = '#ddd';
this.getElm().addClass('qui-switch-button-disabled');
},
......@@ -421,7 +421,7 @@ define('qui/controls/buttons/Switch', [
* @param {String} key - attribute name
* @param {String|Number|Object} value - attribute value
*/
$onSetAttribute: function (key, value) {
$onSetAttribute: function(key, value) {
if (!this.$Elm) {
return;
}
......
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
......@@ -14,8 +14,8 @@ define('qui/controls/contextmenu/Separator', [
'css!qui/controls/contextmenu/Separator.css'
], function (Control) {
"use strict";
], function(Control) {
'use strict';
/**
* @class qui/controls/contextmenu/Separator
......@@ -30,13 +30,13 @@ define('qui/controls/contextmenu/Separator', [
return new Class({
Extends: Control,
Type : 'qui/controls/contextmenu/Separator',
Type: 'qui/controls/contextmenu/Separator',
options: {
styles: null
},
initialize: function (options) {
initialize: function(options) {
this.parent(options);
this.$Elm = null;
......@@ -48,7 +48,7 @@ define('qui/controls/contextmenu/Separator', [
* @method qui/controls/contextmenu/Separator#create
* @return {HTMLElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('div.qui-context-separator', {
'data-quiid': this.getId()
});
......@@ -66,7 +66,7 @@ define('qui/controls/contextmenu/Separator', [
* @method qui/controls/contextmenu/Separator#setNormal
* @ignore
*/
setNormal: function () {
setNormal: function() {
},
/**
......@@ -75,7 +75,7 @@ define('qui/controls/contextmenu/Separator', [
* @method qui/controls/contextmenu/Separator#setActive
* @ignore
*/
setActive: function () {
setActive: function() {
}
});
});
\ No newline at end of file
Dieser Diff ist reduziert.
......@@ -80,6 +80,10 @@
line-height: 40px;
text-align: center;
width: 30px;
display: flex;
align-items: center;
justify-content: center;
}
.qui-panel-footer {
......
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.
Dieser Diff ist reduziert.