Skip to content

Commit

Permalink
Removed IE specific code from WFormWidget
Browse files Browse the repository at this point in the history
and no longer needed WFormWidget::applyEmptyText function
  • Loading branch information
skoehler47 committed Dec 21, 2022
1 parent 1918f81 commit 9e145d1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 35 deletions.
35 changes: 6 additions & 29 deletions src/Wt/WFormWidget.C
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ void WFormWidget::setPlaceholderText(const WString& placeholderText)

WApplication* app = WApplication::instance();
const WEnvironment& env = app->environment();
if (!env.agentIsIElt(10) &&
(domElementType() == DomElementType::INPUT || domElementType() == DomElementType::TEXTAREA)) {
if (domElementType() == DomElementType::INPUT || domElementType() == DomElementType::TEXTAREA) {
flags_.set(BIT_PLACEHOLDER_CHANGED);
repaint();
} else {
Expand Down Expand Up @@ -157,29 +156,13 @@ void WFormWidget::render(WFlags<RenderFlag> flags)

void WFormWidget::updateEmptyText()
{
WApplication *app = WApplication::instance();
const WEnvironment &env = app->environment();
if (isRendered()) {
if (env.agentIsIElt(10)) {
doJavaScript(jsRef() + ".wtObj"
".setEmptyText(" + emptyText_.jsStringLiteral() + ");");
} else {
if (domElementType() == DomElementType::INPUT || domElementType() == DomElementType::TEXTAREA) {
flags_.set(BIT_PLACEHOLDER_CHANGED);
repaint();
}
}
if (isRendered() &&
(domElementType() == DomElementType::INPUT || domElementType() == DomElementType::TEXTAREA)) {
flags_.set(BIT_PLACEHOLDER_CHANGED);
repaint();
}
}

void WFormWidget::applyEmptyText()
{
WApplication *app = WApplication::instance();
const WEnvironment &env = app->environment();
if (env.agentIsIElt(10) && isRendered() && !emptyText_.empty())
doJavaScript(jsRef() + ".wtObj.applyEmptyText();");
}

void WFormWidget::refresh()
{
if (emptyText_.refresh())
Expand Down Expand Up @@ -257,13 +240,7 @@ void WFormWidget::updateDom(DomElement& element, bool all)
if (!all || !isEnabled())
element.setProperty(Wt::Property::Disabled,
isEnabled() ? "false" : "true");

if (!all && isEnabled() && env.agentIsIE()) {
/*
* FIXME: implement a workaround for IE, reenabling a checkbox makes
* the input box loose interactivity.
*/
}

flags_.reset(BIT_ENABLED_CHANGED);
}

Expand Down
2 changes: 0 additions & 2 deletions src/Wt/WFormWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ class WT_API WFormWidget : public WInteractWidget
// also used in WAbstractToggleButton
static const char *CHANGE_SIGNAL;

void applyEmptyText();

virtual void enableAjax() override;

/*! \internal
Expand Down
2 changes: 0 additions & 2 deletions src/Wt/WLineEdit.C
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ void WLineEdit::setText(const WT_USTRING& text)
repaint();

validate();

applyEmptyText();
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/Wt/WTextArea.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ void WTextArea::setText(const WT_USTRING& text)
repaint();

validate();

applyEmptyText();
}

void WTextArea::setColumns(int columns)
Expand Down

0 comments on commit 9e145d1

Please sign in to comment.