style edits and saved message

This commit is contained in:
James B. Pollack 2016-08-23 00:14:53 -07:00
parent d0a25e7783
commit d9a39553bd
4 changed files with 22 additions and 2 deletions

View file

@ -1096,4 +1096,10 @@ input#reset-to-natural-dimensions {
margin-top:5px;
margin-bottom:10px;
background-color: #2e2e2e;
}
#userdata-saved{
margin-top:5px;
font-size:16px;
display:none;
}

View file

@ -212,7 +212,6 @@ div.jsoneditor {
position: relative;
padding: 0;
line-height: 100%;
min-height: 200px;
}
div.jsoneditor-tree table.jsoneditor-tree {
@ -225,6 +224,7 @@ div.jsoneditor-tree table.jsoneditor-tree {
div.jsoneditor-outer {
width: 100%;
height: 100%;
min-height: 150px;
margin: -35px 0 0 0;
padding: 0 0 0 0;
-moz-box-sizing: border-box;

View file

@ -70,7 +70,7 @@
<input type="button" class="red" id="userdata-clear" value="Clear User Data">
<input type="button" class="blue" id="userdata-new-editor" value="Edit as JSON">
<input type="button" class="black" id="userdata-save" value="Save User Data">
<span id="userdata-saved">Saved!</span>
</div>
<div id="static-userdata"></div>
<div id="userdata-editor"></div>

View file

@ -1064,8 +1064,16 @@ function loaded() {
});
var savedJSONTimer = null;
elSaveUserData.addEventListener("click", function() {
setUserDataFromEditor();
$('#userdata-saved').show();
if (savedJSONTimer !== null) {
clearTimeout(savedJSONTimer);
}
savedJSONTimer = setTimeout(function() {
$('#userdata-saved').hide();
}, 1500)
});
elUserData.addEventListener('change', createEmitTextPropertyUpdateFunction('userData'));
@ -1080,6 +1088,12 @@ function loaded() {
showSaveUserDataButton();
});
elJSONEditor.addEventListener('mouseenter', function() {
console.log('mouse in the json editor')
})
elJSONEditor.addEventListener('mouseleave', function() {
console.log('mouse leaves the json editor')
})
var colorChangeFunction = createEmitColorPropertyUpdateFunction(
'color', elColorRed, elColorGreen, elColorBlue);
elColorRed.addEventListener('change', colorChangeFunction);