Permalink
Browse files

fix for context menu on issue #370

  • Loading branch information...
1 parent da21faa commit c67525424f70a7a0ffa635c96a534babd79b7511 Tim Neil committed Feb 25, 2013
Showing with 33 additions and 21 deletions.
  1. +1 −1 JakeVersion
  2. +1 −1 pkg/bbui-min.css
  3. +5 −5 pkg/bbui-min.js
  4. +1 −1 pkg/bbui.css
  5. +3 −7 pkg/bbui.js
  6. +1 −1 samples/bbui.css
  7. +11 −3 samples/bbui.js
  8. +5 −1 src/plugins/_bb10_grid.js
  9. +5 −1 src/plugins/_bb10_imageList.js
View
@@ -2,5 +2,5 @@
"major": 0,
"minor": 9,
"revision": 6,
- "build": 116
+ "build": 117
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* VERSION: 0.9.6.116*/
+/* VERSION: 0.9.6.117*/
body, html {
padding:0;
View
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* VERSION: 0.9.6.116*/
+/* VERSION: 0.9.6.117*/
bb = {
scroller: null,
@@ -251,11 +251,7 @@ bb = {
if (bb.checkbox) bb.checkbox.apply(root.querySelectorAll('input[type=checkbox]'));
if (bb.toggle) bb.toggle.apply(root.querySelectorAll('[data-bb-type=toggle]'));
},
- getCurScreen : function(){
- var numItems = bb.screens.length,
- screen = document.getElementById(bb.screens[numItems-1].guid);
- return screen.querySelector('[data-bb-type=screen]');
- },
+
device: {
isHiRes: false,
isBB5: false,
@@ -2423,7 +2419,7 @@ bb.menuBar = {
div.setAttribute('class','bb-bb10-menu-bar-item-caption-'+res);
div.innerHTML = caption;
bb10MenuItem.appendChild(div);
-
+
// Assign any click handlers
bb10MenuItem.onclick = item.onclick;
bb10Menu.appendChild(bb10MenuItem);
View
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* VERSION: 0.9.6.116*/
+/* VERSION: 0.9.6.117*/
body, html {
padding:0;
View
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* VERSION: 0.9.6.116*/
+/* VERSION: 0.9.6.117*/
bb = {
scroller: null,
@@ -5222,6 +5222,8 @@ _bb10_grid = {
itemNode.contextShown = false;
if (itemNode.contextMenu) {
window.setTimeout(this.touchTimer, 667);
+ var scr = bb.getCurScreen();
+ itemNode.touchstartx = scr.bbUIscrollWrapper.scrollTop;
}
};
itemNode.ontouchend = function() {
@@ -5236,7 +5238,9 @@ _bb10_grid = {
}
};
itemNode.touchTimer = function() {
- if (itemNode.fingerDown) {
+ var scr = bb.getCurScreen();
+ var curx = scr.bbUIscrollWrapper.scrollTop;
+ if (itemNode.fingerDown && Math.abs(itemNode.touchstartx - curx) < 50) {
itemNode.contextShown = true;
itemNode.contextMenu.peek({title:this.title,description:this.description, selected: this});
}
@@ -5671,6 +5675,8 @@ _bb10_imageList = {
innerChildNode.contextShown = false;
if (innerChildNode.contextMenu) {
window.setTimeout(this.touchTimer, 667);
+ var scr = bb.getCurScreen();
+ innerChildNode.touchstartx = scr.bbUIscrollWrapper.scrollTop;
}
};
innerChildNode.ontouchend = function (event) {
@@ -5683,7 +5689,9 @@ _bb10_imageList = {
}
};
innerChildNode.touchTimer = function() {
- if (innerChildNode.fingerDown) {
+ var scr = bb.getCurScreen();
+ var curx = scr.bbUIscrollWrapper.scrollTop;
+ if (innerChildNode.fingerDown && Math.abs(innerChildNode.touchstartx - curx) < 50) {
innerChildNode.contextShown = true;
this.setAttribute('class',this.highlight);
this.overlay.style['border-color'] = bb.options.shades.darkOutline;
@@ -233,6 +233,8 @@ _bb10_grid = {
itemNode.contextShown = false;
if (itemNode.contextMenu) {
window.setTimeout(this.touchTimer, 667);
+ var scr = bb.getCurScreen();
+ itemNode.touchstartx = scr.bbUIscrollWrapper.scrollTop;
}
};
itemNode.ontouchend = function() {
@@ -247,7 +249,9 @@ _bb10_grid = {
}
};
itemNode.touchTimer = function() {
- if (itemNode.fingerDown) {
+ var scr = bb.getCurScreen();
+ var curx = scr.bbUIscrollWrapper.scrollTop;
+ if (itemNode.fingerDown && Math.abs(itemNode.touchstartx - curx) < 50) {
itemNode.contextShown = true;
itemNode.contextMenu.peek({title:this.title,description:this.description, selected: this});
}
@@ -316,6 +316,8 @@ _bb10_imageList = {
innerChildNode.contextShown = false;
if (innerChildNode.contextMenu) {
window.setTimeout(this.touchTimer, 667);
+ var scr = bb.getCurScreen();
+ innerChildNode.touchstartx = scr.bbUIscrollWrapper.scrollTop;
}
};
innerChildNode.ontouchend = function (event) {
@@ -328,7 +330,9 @@ _bb10_imageList = {
}
};
innerChildNode.touchTimer = function() {
- if (innerChildNode.fingerDown) {
+ var scr = bb.getCurScreen();
+ var curx = scr.bbUIscrollWrapper.scrollTop;
+ if (innerChildNode.fingerDown && Math.abs(innerChildNode.touchstartx - curx) < 50) {
innerChildNode.contextShown = true;
this.setAttribute('class',this.highlight);
this.overlay.style['border-color'] = bb.options.shades.darkOutline;

0 comments on commit c675254

Please sign in to comment.