aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni.koivuviita@itmill.com>2009-05-04 06:58:50 +0000
committerJouni Koivuviita <jouni.koivuviita@itmill.com>2009-05-04 06:58:50 +0000
commitaf59c6a464aab31d166215c24b6055305063f728 (patch)
treef55ca4416c5ea37c6a50bc4f577132fa4cb66327 /src/com/itmill
parent891ccaa2eca38b3462950e0dd9362f8be9c2cef4 (diff)
downloadvaadin-framework-af59c6a464aab31d166215c24b6055305063f728.tar.gz
vaadin-framework-af59c6a464aab31d166215c24b6055305063f728.zip
Merges from 6.0 branch. Added i-pressed classname for IButton in IE (down state).
svn changeset:7603/svn branch:theme_2009_03
Diffstat (limited to 'src/com/itmill')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/BrowserInfo.java18
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java4
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IButton.java11
3 files changed, 27 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/BrowserInfo.java b/src/com/itmill/toolkit/terminal/gwt/client/BrowserInfo.java
index 0cfc49e879..42e44d0374 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/BrowserInfo.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/BrowserInfo.java
@@ -96,12 +96,12 @@ public class BrowserInfo {
* Examples: Internet Explorer 6: ".i-ie .i-ie6", Firefox 3.0.4:
* ".i-ff .i-ff3", Opera 9.60: ".i-op .i-op96"
*
- * @param prefix
- * a prefix to add to the classnames
* @return
*/
public String getCSSClass() {
String prefix = "i-";
+ boolean ie8 = false;
+
if (cssClass == null) {
String bs = getBrowserString().toLowerCase();
String b = "";
@@ -121,13 +121,25 @@ public class BrowserInfo {
} else if (bs.indexOf(" msie ") != -1) {
b = "ie";
int i = bs.indexOf(" msie ") + 6;
- v = b + bs.substring(i, i + 1);
+ String ieVersion = bs.substring(i, i + 1);
+ v = b + ieVersion;
+
+ // This adds .i-ie7 for ie8 also.
+ // TODO Remove this when IE8 is no longer run in compatibility
+ // mode
+ if (ieVersion != null && ieVersion.equals("8")) {
+ ie8 = true;
+ }
+
} else if (bs.indexOf("opera/") != -1) {
b = "op";
int i = bs.indexOf("opera/") + 6;
v = b + bs.substring(i, i + 3).replace(".", "");
}
cssClass = prefix + b + " " + prefix + v;
+ if (ie8) {
+ cssClass += " " + prefix + "ie7";
+ }
}
return cssClass;
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java
index aeec3bf1b0..1ed82d51d4 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IAccordion.java
@@ -104,8 +104,8 @@ public class IAccordion extends ITabsheetBase implements
item = getStackItem(index);
item = moveStackItemIfNeeded(item, index, tabUidl);
itemIndex = index;
- item.updateCaption(tabUidl);
}
+ item.updateCaption(tabUidl);
item.setVisible(!hidden);
@@ -448,8 +448,6 @@ public class IAccordion extends ITabsheetBase implements
DOM.setElementProperty(captionNode, "className", CLASSNAME
+ "-item-caption");
close();
-
- updateCaption(tabUidl);
}
@Override
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IButton.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IButton.java
index b4965d580c..52f2c05bc3 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IButton.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IButton.java
@@ -22,6 +22,7 @@ public class IButton extends Button implements Paintable {
private String width = null;
public static final String CLASSNAME = "i-button";
+ private static final String CLASSNAME_DOWN = "i-pressed";
String id;
@@ -136,13 +137,23 @@ public class IButton extends Button implements Paintable {
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN
&& event.getButton() == Event.BUTTON_LEFT) {
clickPending = true;
+ if (BrowserInfo.get().isIE()) {
+ addStyleName(CLASSNAME_DOWN);
+ }
} else if (DOM.eventGetType(event) == Event.ONMOUSEMOVE) {
clickPending = false;
} else if (DOM.eventGetType(event) == Event.ONMOUSEOUT) {
if (clickPending) {
click();
}
+ if (BrowserInfo.get().isIE()) {
+ removeStyleName(CLASSNAME_DOWN);
+ }
clickPending = false;
+ } else if (DOM.eventGetType(event) == Event.ONMOUSEUP) {
+ if (BrowserInfo.get().isIE()) {
+ removeStyleName(CLASSNAME_DOWN);
+ }
}
if (client != null) {