MDL-43152 JavaScript: Fix linting issues with moodle-core-blocks

This commit is contained in:
Andrew Nicols
2013-12-06 09:20:18 +08:00
parent cf0e9701af
commit 12d52ecb3c
4 changed files with 15 additions and 13 deletions
@@ -63,7 +63,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// See if we are missing either of block regions,
// if yes we need to add an empty one to use as target
if (blockregionlist.size() != this.get('regions').length) {
if (blockregionlist.size() !== this.get('regions').length) {
var blockregion = Y.Node.create('<div></div>')
.addClass(CSS.BLOCKREGION);
var regioncontent = Y.Node.create('<div></div>')
@@ -90,7 +90,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it.
var tar = new Y.DD.Drop({
new Y.DD.Drop({
node: blockregionnode.one('div.'+CSS.REGIONCONTENT),
groups: this.groups,
padding: '40 240 40 240'
@@ -199,7 +199,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// Moving from empty region-content towards the opposite one,
// hide empty one (only for region-pre, region-post areas at the moment).
regionname = this.get_region_id(drop.ancestor('div.'+CSS.BLOCKREGION));
if (this.dragsourceregion.all('.'+CSS.BLOCK).size() == 0 && this.dragsourceregion.get('id').match(/(region-pre|region-post)/i)) {
if (this.dragsourceregion.all('.'+CSS.BLOCK).size() === 0 && this.dragsourceregion.get('id').match(/(region-pre|region-post)/i)) {
if (!documentbody.hasClass('side-'+regionname+'-only')) {
documentbody.addClass('side-'+regionname+'-only');
}
@@ -379,7 +379,8 @@ M.core.blockdraganddrop.init = function(params) {
M.core_blocks = M.core_blocks || {};
M.core_blocks.init_dragdrop = function(params) {
M.core.blockdraganddrop.init(params);
};/**
};
/**
* This file contains the drag and drop manager class.
*
* Provides drag and drop functionality for blocks.
File diff suppressed because one or more lines are too long
+5 -4
View File
@@ -63,7 +63,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// See if we are missing either of block regions,
// if yes we need to add an empty one to use as target
if (blockregionlist.size() != this.get('regions').length) {
if (blockregionlist.size() !== this.get('regions').length) {
var blockregion = Y.Node.create('<div></div>')
.addClass(CSS.BLOCKREGION);
var regioncontent = Y.Node.create('<div></div>')
@@ -90,7 +90,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it.
var tar = new Y.DD.Drop({
new Y.DD.Drop({
node: blockregionnode.one('div.'+CSS.REGIONCONTENT),
groups: this.groups,
padding: '40 240 40 240'
@@ -199,7 +199,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// Moving from empty region-content towards the opposite one,
// hide empty one (only for region-pre, region-post areas at the moment).
regionname = this.get_region_id(drop.ancestor('div.'+CSS.BLOCKREGION));
if (this.dragsourceregion.all('.'+CSS.BLOCK).size() == 0 && this.dragsourceregion.get('id').match(/(region-pre|region-post)/i)) {
if (this.dragsourceregion.all('.'+CSS.BLOCK).size() === 0 && this.dragsourceregion.get('id').match(/(region-pre|region-post)/i)) {
if (!documentbody.hasClass('side-'+regionname+'-only')) {
documentbody.addClass('side-'+regionname+'-only');
}
@@ -379,7 +379,8 @@ M.core.blockdraganddrop.init = function(params) {
M.core_blocks = M.core_blocks || {};
M.core_blocks.init_dragdrop = function(params) {
M.core.blockdraganddrop.init(params);
};/**
};
/**
* This file contains the drag and drop manager class.
*
* Provides drag and drop functionality for blocks.
+4 -4
View File
@@ -61,7 +61,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// See if we are missing either of block regions,
// if yes we need to add an empty one to use as target
if (blockregionlist.size() != this.get('regions').length) {
if (blockregionlist.size() !== this.get('regions').length) {
var blockregion = Y.Node.create('<div></div>')
.addClass(CSS.BLOCKREGION);
var regioncontent = Y.Node.create('<div></div>')
@@ -88,7 +88,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it.
var tar = new Y.DD.Drop({
new Y.DD.Drop({
node: blockregionnode.one('div.'+CSS.REGIONCONTENT),
groups: this.groups,
padding: '40 240 40 240'
@@ -197,7 +197,7 @@ Y.extend(DRAGBLOCK, M.core.dragdrop, {
// Moving from empty region-content towards the opposite one,
// hide empty one (only for region-pre, region-post areas at the moment).
regionname = this.get_region_id(drop.ancestor('div.'+CSS.BLOCKREGION));
if (this.dragsourceregion.all('.'+CSS.BLOCK).size() == 0 && this.dragsourceregion.get('id').match(/(region-pre|region-post)/i)) {
if (this.dragsourceregion.all('.'+CSS.BLOCK).size() === 0 && this.dragsourceregion.get('id').match(/(region-pre|region-post)/i)) {
if (!documentbody.hasClass('side-'+regionname+'-only')) {
documentbody.addClass('side-'+regionname+'-only');
}
@@ -377,4 +377,4 @@ M.core.blockdraganddrop.init = function(params) {
M.core_blocks = M.core_blocks || {};
M.core_blocks.init_dragdrop = function(params) {
M.core.blockdraganddrop.init(params);
};
};