|
@@ -24,6 +24,7 @@ class View<T> extends hide.comp.Component {
|
|
|
|
|
|
var contentWidth(get,never) : Int;
|
|
var contentWidth(get,never) : Int;
|
|
var contentHeight(get,never) : Int;
|
|
var contentHeight(get,never) : Int;
|
|
|
|
+ var needRebuild : Bool;
|
|
|
|
|
|
public function new(state:T) {
|
|
public function new(state:T) {
|
|
super(null,null);
|
|
super(null,null);
|
|
@@ -146,8 +147,23 @@ class View<T> extends hide.comp.Component {
|
|
element = cont.getElement();
|
|
element = cont.getElement();
|
|
}
|
|
}
|
|
|
|
|
|
- public function rebuild() {
|
|
|
|
- if( container == null ) return;
|
|
|
|
|
|
+ public final function rebuild() {
|
|
|
|
+ function checkRebuild() {
|
|
|
|
+ if( container == null || !needRebuild ) return;
|
|
|
|
+ if( !isActive() ) {
|
|
|
|
+ haxe.Timer.delay(checkRebuild,200);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ needRebuild = false;
|
|
|
|
+ onRebuild();
|
|
|
|
+ }
|
|
|
|
+ if( !needRebuild ) {
|
|
|
|
+ needRebuild = true;
|
|
|
|
+ checkRebuild();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function onRebuild() {
|
|
for( w in watches.copy() )
|
|
for( w in watches.copy() )
|
|
if( !w.keep ) {
|
|
if( !w.keep ) {
|
|
ide.fileWatcher.unregister(w.path, w.callb);
|
|
ide.fileWatcher.unregister(w.path, w.callb);
|
|
@@ -169,6 +185,10 @@ class View<T> extends hide.comp.Component {
|
|
public function onActivate() {
|
|
public function onActivate() {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function isActive() {
|
|
|
|
+ return container != null && !container.isHidden;
|
|
|
|
+ }
|
|
|
|
+
|
|
public function onDragDrop(items : Array<String>, isDrop : Bool) {
|
|
public function onDragDrop(items : Array<String>, isDrop : Bool) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -188,7 +208,7 @@ class View<T> extends hide.comp.Component {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public function saveState() {
|
|
|
|
|
|
+ function saveState() {
|
|
container.setState(state);
|
|
container.setState(state);
|
|
}
|
|
}
|
|
|
|
|