delete unused code / cleanup
issue: TOBAGO-1633: TS refactoring
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
index e4e01ff..44818ba 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/TreeRenderer.java
@@ -53,13 +53,13 @@
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- protected static final String SCROLL_POSITION = ComponentUtils.SUB_SEPARATOR + "scrollPosition";
+ protected static final String SCROLL_POSITION = "scrollPosition";
@Override
public void decode(final FacesContext facesContext, final UIComponent component) {
final AbstractUITree tree = (AbstractUITree) component;
final String value = facesContext.getExternalContext().getRequestParameterMap().get(
- tree.getClientId(facesContext) + SCROLL_POSITION);
+ tree.getClientId(facesContext) + ComponentUtils.SUB_SEPARATOR + SCROLL_POSITION);
if (value != null) {
tree.getState().getScrollPosition().update(value);
}
@@ -162,11 +162,11 @@
writer.endElement(HtmlElements.INPUT);
writer.startElement(HtmlElements.INPUT);
- writer.writeIdAttribute(clientId + SCROLL_POSITION);
- writer.writeNameAttribute(clientId + SCROLL_POSITION);
+ writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + SCROLL_POSITION);
+ writer.writeNameAttribute(clientId + ComponentUtils.SUB_SEPARATOR + SCROLL_POSITION);
writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.HIDDEN);
writer.writeAttribute(HtmlAttributes.VALUE, tree.getState().getScrollPosition().encode(), false);
- writer.writeAttribute(DataAttributes.SCROLL_POSITION, Boolean.TRUE.toString(), true);
+ writer.writeAttribute(DataAttributes.SCROLL_POSITION, Boolean.TRUE.toString(), false);
writer.endElement(HtmlElements.INPUT);
writer.endElement(HtmlElements.DIV);
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts
index d90707d..66b8423 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-utils.ts
@@ -189,52 +189,4 @@
}
return id.substring(0, id.lastIndexOf(":"));
}
-
- /**
- * fix position, when the element it is outside of the current page
- * @param elements is an jQuery Array of elements to be fixed.
- */
- static keepElementInVisibleArea(elements) {
- elements.each(function () {
- var element = jQuery(this);
- var page = jQuery(".tobago-page-content:first");
- var left = element.offset().left;
- var top = element.offset().top;
- // fix menu position, when it is outside of the current page
- left = Math.max(0, Math.min(left, page.outerWidth() - element.outerWidth()));
- top = Math.max(0, Math.min(top, page.outerHeight() - element.outerHeight()));
- element.css('left', left);
- element.css('top', top);
- });
- }
-
- static addDataMarkup(element, markupString) {
- var dataTobagoMarkup = element.attr("data-tobago-markup");
- if (dataTobagoMarkup !== undefined) {
- var markups = jQuery.parseJSON(dataTobagoMarkup);
- markups.push(markupString);
- element.attr("data-tobago-markup", JSON.stringify(markups));
- } else {
- element.attr("data-tobago-markup", JSON.stringify(markupString));
- }
- }
-
- static removeDataMarkup(element, markupString) {
- var dataTobagoMarkup = element.attr("data-tobago-markup");
- if (dataTobagoMarkup !== undefined) {
- var markups = jQuery.parseJSON(dataTobagoMarkup);
- var index = jQuery.inArray(markupString, markups);
- if (index >= 0) {
- markups.splice(index, 1);
- } else if (markups === markupString) {
- markups = [];
- }
-
- if (markups.length > 0) {
- element.attr("data-tobago-markup", JSON.stringify(markups));
- } else {
- element.removeAttr("data-tobago-markup");
- }
- }
- }
}
\ No newline at end of file