From 70e57e95ad8992b83cc04ce981119a9b9c8094ed Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Nov 2015 09:54:41 +0530 Subject: [PATCH] Use JS bind() instead of RS bind() --- src/pyj/book_list/boss.pyj | 2 +- src/pyj/book_list/ui.pyj | 2 +- src/pyj/book_list/views.pyj | 4 ++-- src/pyj/modals.pyj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pyj/book_list/boss.pyj b/src/pyj/book_list/boss.pyj index adcbfbb9f0..c798f326cd 100644 --- a/src/pyj/book_list/boss.pyj +++ b/src/pyj/book_list/boss.pyj @@ -13,7 +13,7 @@ class Boss: self.current_library_name = interface_data['library_map'][self.current_library_id] self.update_window_title() self.ui = UI(interface_data) - window.onerror = bind(self.onerror, self) + window.onerror = self.onerror.bind(self) def update_window_title(self): document.title = 'calibre :: ' + self.current_library_name diff --git a/src/pyj/book_list/ui.pyj b/src/pyj/book_list/ui.pyj index 2b6c1900c4..d265459a1c 100644 --- a/src/pyj/book_list/ui.pyj +++ b/src/pyj/book_list/ui.pyj @@ -88,7 +88,7 @@ class UI: self.states.append(UIState(ibs, self.books_view)) self.apply_state(self.states[0]) ibs.left_state.run_animation = False - window.addEventListener('resize', debounce(bind(self.on_resize, self), 250)) + window.addEventListener('resize', debounce(self.on_resize.bind(self), 250)) self.panels = v'[self.books_view, self.items_view]' def on_resize(self): diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index 2962f683d0..c68855b701 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -57,8 +57,8 @@ class BooksView: mode = 'cover_grid' self.mode = mode if mode == 'cover_grid': - self.render_book = bind(self.cover_grid_item, self) - self.init_grid = bind(self.init_cover_grid, self) + self.render_book = self.cover_grid_item.bind(self) + self.init_grid = self.init_cover_grid.bind(self) self.init_grid() self.render_ids() diff --git a/src/pyj/modals.pyj b/src/pyj/modals.pyj index fd3b5641c4..22ef9dd016 100644 --- a/src/pyj/modals.pyj +++ b/src/pyj/modals.pyj @@ -59,7 +59,7 @@ class ModalContainer: self.modals = v'[]' self.current_modal = None - self.hide = bind(self.close_modal, self) + self.hide = self.close_modal.bind(self) @property def modal_container(self):