如果侦听器已存在,则阻止添加侦听器

时间:2018-03-19 22:49:28

标签: google-maps-api-3

我想阻止我的GMaps对象添加不需要的侦听器。

map

如果已经有“点击”侦听器,如何阻止// Disable foreign key checks! DB::statement('SET FOREIGN_KEY_CHECKS=0;'); // Move users from old table to the new one $entries = DB::connection('mysql_old')->table('users')->get(); DB::table('users')->truncate(); foreach($entries as $entry){ $user = \App\User::create([ 'name' => $entry->name, 'email' => $entry->email, 'status' => $entry->status, 'credits' => $entry->credits, 'role' => $entry->user_role, 'email_subscription' => $entry->email_subscription, 'activation_key' => $entry->activation_key, 'password' => $entry->password, 'remember_token' => $entry->remember_token, 'created_at' => $entry->created_at, 'updated_at' => $entry->updated_at ]); } // Enable foreign key checks! DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 添加“点击”侦听器?

1 个答案:

答案 0 :(得分:1)

这是无法实现的。无法检测是否添加了事件侦听器。

有一种相当复杂的方法:

请参阅:https://stackoverflow.com/a/47414605/7138697

相关问题