Skip to content

Commit

Permalink
fix: remove contenttree JS
Browse files Browse the repository at this point in the history
  • Loading branch information
toutpt committed Aug 19, 2013
1 parent 6c0fef3 commit 488903e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion collective/rcse/monkey.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import logging
from collective.z3cform.widgets import enhancedtextlines

#Remove this because it's useless for us
logger = logging.getLogger("collective.rcse")

logger.info("monkeypatch: EnhancedTextLinesWidget do nothing if no taskplease")
enhancedtextlines.EnhancedTextLinesWidget.js_template = """\
(function($) {
$().ready(function() {
Expand All @@ -16,3 +19,19 @@
});
})(jQuery);
"""


logger.info("monkeypatch: Remove contenttree for mobile")
def patch_contenttree():
from plone.formwidget.contenttree.widget import ContentTreeBase
from plone.browserlayer import utils
from collective.rcse.layer import MobileLayer
original_render = ContentTreeBase.render
def render(self):
if MobileLayer.providedBy(self.request):
return u"This feature is not supported"
else:
return original_render(self)
ContentTreeBase.render = render

patch_contenttree()

0 comments on commit 488903e

Please sign in to comment.