ncannasse 7 роки тому
батько
коміт
6b992291c2
3 змінених файлів з 4 додано та 5 видалено
  1. 1 2
      hide/prefab/Prefab.hx
  2. 1 1
      hide/tools/FileWatcher.hx
  3. 2 2
      hide/ui/View.hx

+ 1 - 2
hide/prefab/Prefab.hx

@@ -51,8 +51,7 @@ class Prefab {
 	}
 
 	public function makeInstance( ctx : Context ) : Context {
-		throw "Not implemented";
-		return null;
+		return ctx;
 	}
 
 	public function saveRec() : {} {

+ 1 - 1
hide/tools/FileWatcher.hx

@@ -14,7 +14,7 @@ class FileWatcher {
 		w.events.push({ path : path, fun : updateFun, checkDel : checkDelete });
 	}
 
-	public function unregister( path : String, updateFun ) {
+	public function unregister( path : String, updateFun : Void -> Void ) {
 		var w = getWatches(path);
 		for( e in w.events )
 			if( Reflect.compareMethods(e.fun, updateFun) ) {

+ 2 - 2
hide/ui/View.hx

@@ -113,7 +113,7 @@ class View<T> extends hide.comp.Component {
 		if( container == null ) return;
 		for( w in watches.copy() )
 			if( !w.keep ) {
-				ide.fileWatcher.unregister(w.path, w.path);
+				ide.fileWatcher.unregister(w.path, w.callb);
 				watches.remove(w);
 			}
 		syncTitle();
@@ -140,7 +140,7 @@ class View<T> extends hide.comp.Component {
 
 	function destroy() {
 		for( w in watches.copy() )
-			ide.fileWatcher.unregister(w.path, w.path);
+			ide.fileWatcher.unregister(w.path, w.callb);
 		watches = [];
 		@:privateAccess ide.views.remove(this);
 		for( c in container.getElement().find("canvas") ) {