From 3045d510d7f49bb54089c65148c2bd4432402156 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 27 Jul 2012 16:15:59 +0100 Subject: [PATCH] MDL-47494 ddwtos: Hilight drop target, and use YUI dd groups. --- question/type/ddwtos/styles.css | 9 +++++++-- question/type/ddwtos/yui/dd/dd.js | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/question/type/ddwtos/styles.css b/question/type/ddwtos/styles.css index 6332fb9a7d9..f245481df19 100644 --- a/question/type/ddwtos/styles.css +++ b/question/type/ddwtos/styles.css @@ -36,10 +36,15 @@ -moz-box-shadow: 3px 3px 4px #000; -webkit-box-shadow: 3px 3px 4px #000; box-shadow: 3px 3px 4px #000; - /* For IE 8 */ - -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"; /* For IE 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000'); + /* For IE 8 */ + -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"; +} + +.que.ddwtos .drop.yui3-dd-drop-over.yui3-dd-drop-active-valid { + border-color: #0a0; + box-shadow: 0 0 5px 5px rgba(255, 255, 150, 1); } .que.ddwtos .notreadonly .drag { diff --git a/question/type/ddwtos/yui/dd/dd.js b/question/type/ddwtos/yui/dd/dd.js index 0e5654a9c44..2169b72cadf 100644 --- a/question/type/ddwtos/yui/dd/dd.js +++ b/question/type/ddwtos/yui/dd/dd.js @@ -206,6 +206,7 @@ YUI.add('moodle-qtype_ddwtos-dd', function(Y) { var group = this.get_group(drag); var dd = new Y.DD.Drag({ node: drag, + groups: [this.get_group(drag)], dragMode: 'point' }).plug(Y.Plugin.DDConstrained, {constrain2node: this.selectors.top_node()}); }, @@ -214,7 +215,8 @@ YUI.add('moodle-qtype_ddwtos-dd', function(Y) { }, make_drop_zone : function (drop) { var dropdd = new Y.DD.Drop({ - node: drop}); + node: drop, + groups: [this.get_group(drop)] }); dropdd.on('drop:hit', function(e) { var drag = e.drag.get('node'); var drop = e.drop.get('node');