Commit 56256f09 authored by Carlos's avatar Carlos

Merge branch 'master' of https://github.com/carlosperate/ardublockly which...

Merge branch 'master' of https://github.com/carlosperate/ardublockly which contains changes from upstream
parents 7f117a55 7dc329be
This diff is collapsed.
......@@ -127,7 +127,24 @@ Blockly.FieldDropdown.prototype.showEditor_ = function() {
menu.addChild(menuItem, true);
menuItem.setChecked(value == this.value_);
}
// Listen for mouse/keyboard events.
goog.events.listen(menu, goog.ui.Component.EventType.ACTION, callback);
// Listen for touch events (why doesn't Closure handle this already?).
function callbackTouchStart(e) {
var control = this.getOwnerControl(/** @type {Node} */ (e.target));
// Highlight the menu item.
control.handleMouseDown(e);
}
function callbackTouchEnd(e) {
var control = this.getOwnerControl(/** @type {Node} */ (e.target));
// Activate the menu item.
control.performActionInternal(e);
}
menu.getHandler().listen(menu.getElement(), goog.events.EventType.TOUCHSTART,
callbackTouchStart);
menu.getHandler().listen(menu.getElement(), goog.events.EventType.TOUCHEND,
callbackTouchEnd);
// Record windowSize and scrollOffset before adding menu.
var windowSize = goog.dom.getViewportSize();
var scrollOffset = goog.style.getViewportPageOffset(document);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment