mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Dont send add and remove class calls if no comm exists
This commit is contained in:
parent
c31ad5cf78
commit
0f34affc35
@ -304,9 +304,10 @@ class Widget(LoggingConfigurable):
|
|||||||
JQuery selector to select the DOM element(s) that the class(es) will
|
JQuery selector to select the DOM element(s) that the class(es) will
|
||||||
be added to.
|
be added to.
|
||||||
"""
|
"""
|
||||||
self._comm.send({"method": "add_class",
|
if self._comm is not None:
|
||||||
"class_list": class_name,
|
self._comm.send({"method": "add_class",
|
||||||
"selector": selector})
|
"class_list": class_name,
|
||||||
|
"selector": selector})
|
||||||
|
|
||||||
|
|
||||||
def remove_class(self, class_name, selector=""):
|
def remove_class(self, class_name, selector=""):
|
||||||
@ -321,9 +322,10 @@ class Widget(LoggingConfigurable):
|
|||||||
JQuery selector to select the DOM element(s) that the class(es) will
|
JQuery selector to select the DOM element(s) that the class(es) will
|
||||||
be removed from.
|
be removed from.
|
||||||
"""
|
"""
|
||||||
self._comm.send({"method": "remove_class",
|
if self._comm is not None:
|
||||||
"class_list": class_name,
|
self._comm.send({"method": "remove_class",
|
||||||
"selector": selector})
|
"class_list": class_name,
|
||||||
|
"selector": selector})
|
||||||
|
|
||||||
|
|
||||||
def send(self, content):
|
def send(self, content):
|
||||||
|
Loading…
Reference in New Issue
Block a user