Skip to content
Browse files

[NEXUS-5360] Move Ext.grid.CheckColumn into Nexus namespace

  • Loading branch information...
1 parent b63be8e commit c375606b84ac1392cb49f2acb4608d05ce3dec54 @nabcos nabcos committed with cstamas Nov 15, 2012
View
2 nexus/nexus-webapp/src/main/webapp/js/ext/all.js
@@ -12,7 +12,7 @@
*/
/*global define*/
define('ext/all',
- ['extjs', 'ext/ux', 'ext/data', 'ext/dd', 'ext/form', 'ext/grid',
+ ['extjs', 'ext/ux', 'ext/data', 'ext/dd', 'ext/form',
'ext/layout', 'ext/lib', 'ext/tree', 'ext/component',
'ext/string', 'ext/tooltip'],
function(Ext) {
View
50 nexus/nexus-webapp/src/main/webapp/js/ext/grid/checkcolumn.js
@@ -1,50 +0,0 @@
-/*
- * Sonatype Nexus (TM) Open Source Version
- * Copyright (c) 2007-2012 Sonatype, Inc.
- * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
- *
- * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
- * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
- * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
- * Eclipse Foundation. All other trademarks are the property of their respective owners.
- */
-/*global define*/
-define('ext/grid/checkcolumn',['extjs'], function(Ext) {
-Ext.grid.CheckColumn = function(config) {
- Ext.apply(this, config);
- if (!this.id)
- {
- this.id = Ext.id();
- }
- this.renderer = this.renderer.createDelegate(this);
-};
-
-Ext.grid.CheckColumn.prototype = {
- init : function(grid) {
- this.grid = grid;
- this.grid.on('render', function() {
- var view = this.grid.getView();
- view.mainBody.on('mousedown', this.onMouseDown, this);
- }, this);
- },
-
- onMouseDown : function(e, t) {
- if (t.className && t.className.indexOf('x-grid3-cc-' + this.id) !== -1)
- {
- e.stopEvent();
- var
- index = this.grid.getView().findRowIndex(t),
- record = this.grid.store.getAt(index);
-
- record.set(this.dataIndex, !record.data[this.dataIndex]);
- }
- },
-
- renderer : function(v, p, record) {
- p.css += ' x-grid3-check-col-td';
- return '<div class="x-grid3-check-col' + (v ? '-on' : '') + ' x-grid3-cc-' + this.id + '">&#160;</div>';
- }
-};
-});
View
14 nexus/nexus-webapp/src/main/webapp/js/nexus/all.js
@@ -10,4 +10,16 @@
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
-define('nexus/all',['nexus/config', 'nexus/error', 'nexus/ext', 'nexus/form', 'nexus/log', 'nexus/messagebox', 'nexus/navigation', 'nexus/panels', 'nexus/profile', 'nexus/util'], function(){});
+define('nexus/all',
+ ['nexus/config',
+ 'nexus/error',
+ 'nexus/ext',
+ 'nexus/form',
+ 'nexus/log',
+ 'nexus/messagebox',
+ 'nexus/navigation',
+ 'nexus/panels',
+ 'nexus/grid',
+ 'nexus/profile',
+ 'nexus/util'],
+ function() {});
View
4 ...xus-webapp/src/main/webapp/js/ext/grid.js → ...s-webapp/src/main/webapp/js/nexus/grid.js
@@ -11,8 +11,8 @@
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
/*global define*/
-define('ext/grid',
+define('nexus/grid',
[
- 'ext/grid/checkcolumn'
+ 'nexus/grid/checkcolumn'
],
function() {});
View
53 nexus/nexus-webapp/src/main/webapp/js/nexus/grid/checkcolumn.js
@@ -0,0 +1,53 @@
+/*
+ * Sonatype Nexus (TM) Open Source Version
+ * Copyright (c) 2007-2012 Sonatype, Inc.
+ * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
+ *
+ * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
+ * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
+ * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
+ * Eclipse Foundation. All other trademarks are the property of their respective owners.
+ */
+/*global define*/
+define('nexus/grid/checkcolumn', ['extjs', 'nexus'], function(Ext, Nexus) {
+ Ext.namespace('Nexus.grid');
+
+ Nexus.grid.CheckColumn = function(config) {
+ Ext.apply(this, config);
+ if (!this.id) {
+ this.id = Ext.id();
+ }
+ this.renderer = this.renderer.createDelegate(this);
+ };
+
+ Nexus.grid.CheckColumn.prototype = {
+ init : function(grid) {
+ this.grid = grid;
+ this.grid.on('render', function() {
+ var view = this.grid.getView();
+ view.mainBody.on('mousedown', this.onMouseDown, this);
+ }, this);
+ },
+
+ onMouseDown : function(e, t) {
+ if (t.className && t.className.indexOf('x-grid3-cc-' + this.id) !== -1) {
+ e.stopEvent();
+ var
+ index = this.grid.getView().findRowIndex(t),
+ record = this.grid.store.getAt(index);
+
+ record.set(this.dataIndex, !record.data[this.dataIndex]);
+ }
+ },
+
+ renderer : function(v, p, record) {
+ p.css += ' x-grid3-check-col-td';
+ return '<div class="x-grid3-check-col' + (v ? '-on' : '') + ' x-grid3-cc-' + this.id + '">&#160;</div>';
+ }
+ };
+
+ // legacy: use Ext namespace as well
+ Ext.grid.CheckColumn = Nexus.grid.CheckColumn;
+});

0 comments on commit c375606

Please sign in to comment.
Something went wrong with that request. Please try again.