...
|
...
|
@@ -29,7 +29,7 @@ var yoho = { |
|
|
*/
|
|
|
data: window.yohoInterfaceData,
|
|
|
|
|
|
ready(callback) {
|
|
|
ready: function(callback) {
|
|
|
if (this.isApp) {
|
|
|
document.addEventListener('deviceready', callback);
|
|
|
} else {
|
...
|
...
|
@@ -44,7 +44,7 @@ var yoho = { |
|
|
* @param success 调用成功的回调方法
|
|
|
* @param fail 调用失败的回调方法
|
|
|
*/
|
|
|
invokeMethod(method, args, success, fail) {
|
|
|
invokeMethod: function(method, args, success, fail) {
|
|
|
var appInterface = window.yohoInterface;
|
|
|
|
|
|
if (this.isApp && appInterface) {
|
...
|
...
|
@@ -62,7 +62,7 @@ var yoho = { |
|
|
* @param name 方法名
|
|
|
* @param callback 回调
|
|
|
*/
|
|
|
addNativeMethod(name, callback) {
|
|
|
addNativeMethod: function(name, callback) {
|
|
|
var appInterface = window.yohoInterface;
|
|
|
|
|
|
// 延迟 500ms 注入
|
...
|
...
|
|