fix: floaty.closeAll() not found

This commit is contained in:
hyb1996
2018-02-28 09:52:32 +08:00
parent 3de96662c6
commit c0b03d89d5
6 changed files with 14 additions and 9 deletions

View File

@@ -1,18 +1,18 @@
module.exports = function(__runtime__, scope){
module.exports = function(runtime, global){
var floaty = {};
floaty.window = function(layout){
if(typeof(layout) == 'xml'){
layout = layout.toString();
}
return wrap(__runtime__.floaty.window(layout));
return wrap(runtime.floaty.window(layout));
}
floaty.__view_cache__ = {};
function wrap(window){
var proxyObject = new com.stardust.autojs.rhino.ProxyJavaObject(scope, window, window.getClass());
var proxyObject = new com.stardust.autojs.rhino.ProxyJavaObject(global, window, window.getClass());
proxyObject.__proxy__ = {
set: function(name, value){
window[name] = value;
@@ -37,6 +37,8 @@ module.exports = function(__runtime__, scope){
};
return proxyObject;
}
floaty.closeAll = runtime.floaty.closeAll.bind(runtime.floaty);
return floaty;
}