From 36b0213533718411277f15374434e71d8f8bd800 Mon Sep 17 00:00:00 2001 From: Sean Lip Date: Mon, 28 Nov 2016 14:26:38 -0800 Subject: [PATCH] Streamline the logic for block selection callbacks in the toolbox modal. --- accessible/block-options-modal.service.js | 4 +-- accessible/clipboard.service.js | 4 +-- accessible/sidebar.component.js | 6 ++-- accessible/toolbox-modal.component.js | 16 +++++++--- accessible/toolbox-modal.service.js | 39 ++++++++++------------- 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/accessible/block-options-modal.service.js b/accessible/block-options-modal.service.js index 3df6a1aa8..6b77b92bd 100644 --- a/accessible/block-options-modal.service.js +++ b/accessible/block-options-modal.service.js @@ -46,9 +46,7 @@ blocklyApp.BlockOptionsModalService = ng.core.Class({ this.actionButtonsInfo = actionButtonsInfo; this.onCancelCallback = onCancelCallback; - if (this.preShowHook) { - this.preShowHook(); - } + this.preShowHook(); this.modalIsShown = true; }, hideModal: function() { diff --git a/accessible/clipboard.service.js b/accessible/clipboard.service.js index 0a51c44b7..da3281cd8 100644 --- a/accessible/clipboard.service.js +++ b/accessible/clipboard.service.js @@ -78,9 +78,9 @@ blocklyApp.ClipboardService = ng.core.Class({ markedSpotAncestorBlock = markedSpotAncestorBlock.getParent(); } - return this.canBeCopiedToMarkedConnection(block); + return this.canBeAttachedToMarkedConnection(block); }, - canBeCopiedToMarkedConnection: function(block) { + canBeAttachedToMarkedConnection: function(block) { if (!this.markedConnection_ || !this.markedConnection_.getSourceBlock().workspace) { return false; diff --git a/accessible/sidebar.component.js b/accessible/sidebar.component.js index 52901867b..225195b16 100644 --- a/accessible/sidebar.component.js +++ b/accessible/sidebar.component.js @@ -37,7 +37,7 @@ blocklyApp.SidebarComponent = ng.core.Component({ {{buttonConfig.text}} -