Download & Extend

Inconsistent code style in toolbar.js

Project:Drupal core
Version:7.x-dev
Component:toolbar.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Toolbar.js is using the Drupal.admin namespace. No other module uses this, nor should toolbar. It can use some more cleaning but lets review this one first to keep things simple.

AttachmentSizeStatusTest resultOperations
toolbarcleanup.patch3.43 KBIdlePassed on all environments.View details

Comments

#1

The patch was almost there but Drupal.behaviors.admin should be Drupal.behaviors.toolbar. Using the admin on the end is a namespace mismatch. The attached patch changes that as well.

AttachmentSizeStatusTest resultOperations
toolbar-remove-admin_686670_1.patch3.3 KBIdlePassed on all environments.View details

#2

Also note, the deeper something is nested in JavaScript the slower it is. By removing the extra layer of referencing there is an ever so small performance improvement.

#3

looks like u got em all in the code, but shouldn't u also change the comments?

/**
* Implementation of Drupal.behaviors for admin.
*/
Drupal.behaviors.toolbar = {

/**
* Collapse the admin toolbar.
*/
Drupal.toolbar.collapse = function() {

#4

Status:needs review» needs work

#5

Status:needs work» needs review

changed comments

AttachmentSizeStatusTest resultOperations
toolbar-remove-admin_686670_5.patch3.64 KBIdlePASSED: [[SimpleTest]]: [MySQL] 17,389 pass(es).View details

#6

+++ modules/toolbar/toolbar.js
@@ -1,18 +1,20 @@
/**
- * Implementation of Drupal.behaviors for admin.
+ * Implementation of Drupal.behaviors for the toolbar.
  */

This should either state what the behavior is actually doing, or it simply needs to go. The former is preferred ;)

Powered by Dreditor.

#7

Updated the patch per Suns comments.

AttachmentSizeStatusTest resultOperations
toolbar-remove-admin_686670_7.patch3.64 KBIdlePASSED: [[SimpleTest]]: [MySQL] 17,386 pass(es).View details

#8

Status:needs review» reviewed & tested by the community

Thanks, looks good now - didn't test though. (hope you did ;)

#9

I did test it... works :)

#10

yay \o/

#11

Status:reviewed & tested by the community» fixed

Thanks. This is probably leftover from when yhahn made a Drupal 7 patch from Admin module.

Committed to HEAD.

#12

Status:fixed» needs review

There are some more strings to be changed in toolbar.module.
Correcting these fixes sticky tables.

AttachmentSizeStatusTest resultOperations
toolbar-remove-admin.patch1.12 KBIdlePASSED: [[SimpleTest]]: [MySQL] 17,312 pass(es).View details

#13

Status:needs review» reviewed & tested by the community

#14

Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks!

#15

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here