Commit 0b519ffb authored by Julien Cristau's avatar Julien Cristau
Browse files

[view] Delete dead(?) code from ReloadableMixIn

Nothing seems to ever call user_callback on the Component, only on the
request.  Related to #3567793
parent e45bf9baa7b7
......@@ -501,28 +501,6 @@ class MainTemplate(View):
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__)
......
......@@ -36,8 +36,6 @@ class AddRelationView(component.EditRelationMixIn, View):
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']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment