Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Fix flexcontainer saving issues; fix size restore issues; close #1 and
Browse files Browse the repository at this point in the history
  • Loading branch information
xeniarose committed Sep 5, 2016
1 parent f621e8c commit c0ef383
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class Container extends DraggableElement {
}
};
this.key = "";
this.restoreSave();
super._registerDom(this.dom);
this.restoreSave();
}

restoreSave(){
Expand Down
2 changes: 2 additions & 0 deletions DraggableElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class DraggableElement {
} else {
this.style.height = (e.clientY - sy + oh + 5) + "px";
}
self._sizeReset = false;
self._w = this.offsetWidth;
self._h = this.offsetHeight;
} else {
Expand Down Expand Up @@ -336,6 +337,7 @@ class DraggableElement {
this.dom.style.width = this.dom.style.height = null;
this._w = this.dom.offsetWidth;
this._h = this.dom.offsetHeight;
this._sizeReset = true;
}

getPosition() {
Expand Down
12 changes: 12 additions & 0 deletions default-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,17 @@ class USBCameraStream extends UnlinkedWidget {
win.addField({ value: "fps", display: "FPS" }, "number", self.saveData.fps, cb);
}

createContextMenu(menu){
var self = this;
menu.append(new gui.MenuItem({
label: "Reconnect",
click: function () {
clearTimeout(this.listenTimeout);
self.listen();
}
}));
}

destroy(){
this._destroyed = true;
try {
Expand All @@ -926,6 +937,7 @@ class USBCameraStream extends UnlinkedWidget {
}

connError(err){
// todo: catch when an error happens because the robot suddenly disconnects. Currently that's not happening and the client sits there, not trying to reconnect
console.error("USBCameraStream: ", err);
this._img.src = "";
if(err && err.message) this._img.alt = "Stream error: " + err.message;
Expand Down
4 changes: 2 additions & 2 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,8 @@ input[type=checkbox].redgreen:checked {
position: relative;
top: 0px !important;
left: 0px !important;
/*width: 100% !important;
height: 100% !important;*/
width: initial !important;
height: initial !important;
margin: 0;
}

Expand Down
3 changes: 3 additions & 0 deletions launcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
text-align: center;
padding: 0;
margin: 0;
user-select: none;
-webkit-user-select: none;
cursor: default;
}

h1 {
Expand Down

0 comments on commit c0ef383

Please sign in to comment.