Skip to content
This repository has been archived by the owner on Mar 12, 2018. It is now read-only.

Commit

Permalink
MDL-39949 - Blocks - preventing blocks with empty titles from blockin…
Browse files Browse the repository at this point in the history
…g the execution of javascript
  • Loading branch information
jsnfwlr committed Jun 11, 2013
1 parent b3be471 commit 74dfade
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions blocks/dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,15 @@ M.core_dock.genericblock.prototype = {
}

// Must set the image src seperatly of we get an error with XML strict headers
var moveto = Y.Node.create('<input type="image" class="moveto customcommand requiresjs" alt="'+M.str.block.addtodock+'" title="'+
Y.Escape.html(M.util.get_string('dockblock', 'block', node.one('.header .title h2').getHTML())) +'" />');
var moveto = Y.Node.create('<input type="image" class="moveto customcommand requiresjs" />');
var header = node.one('.header .title h2');
moveto.setAttribute('alt', Y.Escape.html(M.util.get_string('addtodock', 'block')));
if (header) {
moveto.setAttribute('title', Y.Escape.html(M.util.get_string('dockblock', 'block', header.getHTML())));
} else {
moveto.setAttribute('title', Y.Escape.html(M.util.get_string('addtodock', 'block')));
}

var icon = 't/block_to_dock';
if (right_to_left()) {
icon = 't/block_to_dock_rtl';
Expand Down

0 comments on commit 74dfade

Please sign in to comment.