summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorjiteshjha2016-07-05 18:12:20 +0530
committerjiteshjha2016-07-05 18:12:20 +0530
commitcfd0c5c2cd23d40e16af772e959916f49f3b5fa6 (patch)
treecc5eea89599f91da8b5a45532348bc0d54d5b15b /index.html
parent1f65dea586ed7ca9e0e843e6f9cce149e6732745 (diff)
downloadxcos-on-web-cfd0c5c2cd23d40e16af772e959916f49f3b5fa6.tar.gz
xcos-on-web-cfd0c5c2cd23d40e16af772e959916f49f3b5fa6.tar.bz2
xcos-on-web-cfd0c5c2cd23d40e16af772e959916f49f3b5fa6.zip
showColorWheel() function now works
Diffstat (limited to 'index.html')
-rw-r--r--index.html21
1 files changed, 16 insertions, 5 deletions
diff --git a/index.html b/index.html
index a7d1a00..4b7adce 100644
--- a/index.html
+++ b/index.html
@@ -743,7 +743,7 @@
if (mxUtils.isNode(cell.value))
{
var stylesheet = graph.getStylesheet();
- var style = stylesheet.styles[cell.style];
+ var style = stylesheet.styles[cell.value.getAttribute('style')];
var displayedLabel = style['displayedLabel'];
if(displayedLabel != null) {
var displayParameter = cell.blockInstance.instance.displayParameter;
@@ -1214,6 +1214,9 @@
*/
function styleToObject(style) {
+ if(style.indexOf(';') == -1) {
+ style = style + ';';
+ }
var defaultStyle = style.substring(0, style.indexOf(';'));
var styleObject = {
@@ -1622,7 +1625,7 @@
var trigger = document.getElementById(button);
var styleObject = styleToObject(style);
var previousValue = 1;
- if ('fontStyle' in styleObjesct) {
+ if ('fontStyle' in styleObject) {
previousValue = styleObject['fontStyle'];
// To get a bit mask:
@@ -1950,7 +1953,11 @@
btn.onclick = function() {
var input = document.getElementById('color').value;
var style = graph.getModel().getStyle(cell);
- var styleObject = styleToObject(style);
+
+ if(style != null) {
+ var styleObject = styleToObject(style);
+ }
+
if (selectProperty == "edgeStrokeColor") {
styleObject['strokeColor'] = input;
} else if (selectProperty == "bgColor") {
@@ -1962,8 +1969,12 @@
} else if (selectProperty == "edgeTextColor") {
styleObject['fontColor'] = input;
}
- style = objectToStyle(styleObject);
- graph.getModel().setStyle(cell, style);
+
+ if(style != null) {
+ style = objectToStyle(styleObject);
+ graph.getModel().setStyle(cell, style);
+ }
+
wind.destroy();
};
myform.appendChild(btn);