[view] Delete dead(?) code from ReloadableMixIn
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 07 Mar 2014 11:19:24 +0100
changeset 9725 2614362be11e
parent 9724 e45bf9baa7b7
child 9726 8905267dc7ae
[view] Delete dead(?) code from ReloadableMixIn Nothing seems to ever call user_callback on the Component, only on the request. Related to #3567793
view.py
web/views/ajaxedit.py
--- a/view.py	Tue Feb 04 15:06:25 2014 +0100
+++ b/view.py	Fri Mar 07 11:19:24 2014 +0100
@@ -501,28 +501,6 @@
 class ReloadableMixIn(object):
     """simple mixin for reloadable parts of UI"""
 
-    def user_callback(self, cb, args, msg=None, nonify=False):
-        """register the given user callback and return an url to call it ready to be
-        inserted in html
-        """
-        self._cw.add_js('cubicweb.ajax.js')
-        if nonify:
-            _cb = cb
-            def cb(*args):
-                _cb(*args)
-        cbname = self._cw.register_onetime_callback(cb, *args)
-        return self.build_js(cbname, xml_escape(msg or ''))
-
-    def build_update_js_call(self, cbname, msg):
-        rql = self.cw_rset.printable_rql()
-        return "javascript: %s" % js.userCallbackThenUpdateUI(
-            cbname, self.__regid__, rql, msg, self.__registry__, self.domid)
-
-    def build_reload_js_call(self, cbname, msg):
-        return "javascript: %s" % js.userCallbackThenReloadPage(cbname, msg)
-
-    build_js = build_update_js_call # expect updatable component by default
-
     @property
     def domid(self):
         return domid(self.__regid__)
--- a/web/views/ajaxedit.py	Tue Feb 04 15:06:25 2014 +0100
+++ b/web/views/ajaxedit.py	Fri Mar 07 11:19:24 2014 +0100
@@ -36,8 +36,6 @@
     cw_property_defs = {} # don't want to inherit this from Box
     expected_kwargs = form_params = ('rtype', 'target')
 
-    build_js = component.EditRelationMixIn.build_reload_js_call
-
     def cell_call(self, row, col, rtype=None, target=None, etype=None):
         self.rtype = rtype or self._cw.form['rtype']
         self.target = target or self._cw.form['target']