Project

General

Profile

Bug #1866 ยป bootstrap_nojs_anchor_fix_20130530a.diff

Bruce Toll, 06/06/2013 03:08 PM

View differences:

src/Wt/WPushButton
virtual void propagateRenderOk(bool deep);
virtual void getDomChanges(std::vector<DomElement *>& result,
WApplication *app);
virtual void enableAjax();
private:
void doRedirect();
src/Wt/WPushButton.C
WFormWidget::refresh();
}
void WPushButton::enableAjax()
{
if (!linkState_.link.isNull()) {
WApplication *app = WApplication::instance();
if (app->theme()->canStyleAnchorAsButton()) {
flags_.set(BIT_LINK_CHANGED);
}
}
WFormWidget::enableAjax();
}
}
src/web/DomElement.C
#include "Wt/WEnvironment"
#include "Wt/WException"
#include "Wt/WStringStream"
#include "Wt/WTheme"
#include "DomElement.h"
#include "WebUtils.h"
......
app->environment().agent() == WEnvironment::IE8 ||
href.length() > 1)
needButtonWrap = false;
else if (app->theme()->canStyleAnchorAsButton()) {
DomElement *self = const_cast<DomElement *>(this);
self->setAttribute("href", app->url(app->internalPath())
+ "&signal=" + clickEvent->second.signalName);
needButtonWrap = false;
}
} else if (type_ == DomElement_AREA) {
DomElement *self = const_cast<DomElement *>(this);
self->setAttribute("href", app->url(app->internalPath())
src/web/skeleton/Wt.js
if (e.getAttribute('type') == 'submit') {
e.setAttribute('type', 'button');
e.removeAttribute('name');
} else if (WT.hasTag(e, 'A') && e.href.indexOf('&signal=')) {
e.href = 'javascript:void(0)';
} if (WT.hasTag(e, 'INPUT') && e.getAttribute('type') == 'image') {
WT.changeTag(e, 'img');
}
    (1-1/1)