Commit e9deeae0 authored by bbaer's avatar bbaer
Browse files

New button template, fixed color error if no colors are given.

parent 88b85ad5
......@@ -109,19 +109,21 @@ $(function (n) {
var $colorSelector = $("<div>", {class: "color-picker"});
$controlWrapper.append($colorSelector);
this.myModes.colors.forEach(function (o) {
var $button = $("<button>", {
type: 'button',
id: o.selector,
class: "text-bg-toggle",
style: "background-color: rgba(" + o.red +"," + o.green + "," + o.blue + ",1)"
if (this.myModes.colors instanceof Array) {
this.myModes.colors.forEach(function (o) {
var $button = $("<button>", {
type: 'button',
id: o.selector,
class: "text-bg-toggle",
style: "background-color: rgba(" + o.red + "," + o.green + "," + o.blue + ",1)"
});
$colorSelector.append($button);
that.myColors.push($button);
$button.on("click", function () {
that.qFabric.setColor(o, $button);
})
});
$colorSelector.append($button);
that.myColors.push($button);
$button.on("click", function() {
that.qFabric.setColor(o, $button);
})
});
}
};
ModeSettings.prototype.setMyModes = function (data) {
......@@ -226,7 +228,7 @@ $(function (n) {
draggable: true
});
$emojiField.append($img);
$img.on("dragstart", function(e) {
$img.on("dragstart", function() {
console.log(o.name + " mouseDown");
that.qFabric.dragAndDrop = true;
that.qFabric.dndData = o.url;
......
......@@ -38,7 +38,7 @@
<div class="row">
<div class="col-md-4">
<div class="fabric" data-buttons="mockData/fabric.buttons.json" data-edit-image="true" data-background-image="mockData/Scan2a.jpeg"></div>
<div class="fabric" data-buttons="mockData/fabric.editor.buttons.json" data-edit-image="true" data-background-image="mockData/Scan2a.jpeg"></div>
</div>
</div>
</div>
......
{
"modes": [
{
"name": "rotateRight",
"selector": "turn-right",
"requiresDrawing": false,
"requiresSelection": false,
"isToggle": false,
"toggle": "",
"hasToggleElement": false,
"toggleElement": "",
"icon": "glyphicon-repeat"
}
],
"currentMode": ""
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment