Selaa lähdekoodia

HUE-62. Allow HtmlTable context menu for multiple rows

removing errant filter (Behavior.FormRequest is in the art-widgets package)
tweaking right click menu hover state styles
enabling the table multiselect menu when rows have no context menu
configuring default HtmlTable noSort class
Aaron Newton 15 vuotta sitten
vanhempi
commit
ba500e2c7f

+ 1 - 1
desktop/core/static/css/shared.css

@@ -396,7 +396,7 @@ div.jframe_default h5 { font-size: 105%; margin-bottom: 0.3em; padding-top: 8px;
 }
 .ccs-shared .context-menu li:hover, .ccs-shared table[data-filters*=HtmlTable] tr.table-tr-selected td ul.context-menu li:hover a, .ccs-shared ul.context-menu li:hover a {
 	text-decoration: none;
-	background-color: #3875D7;
+	background-color: #333;
 	color: #fff;
 }
 .ccs-shared ul.context-menu li:last-child {

+ 0 - 47
desktop/core/static/js/Source/BehaviorFilters/Behavior.FormRequest.js

@@ -1,47 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-/*
----
-description: Creates an instance of Form.Request for every form that JFrame loads.
-provides: [CCS.JFrame.FormRequest]
-requires: [/CCS.JFrame, More/Form.Request]
-script: CCS.JFrame.FormRequest.js
-
-...
-*/
-
-CCS.JFrame.addGlobalFilters({
-
-	formRequest: function(element, events){
-		// Make forms submit inside the jframe
-		container.getElements('form').each(function(form){
-			form.set('action', new URI(form.get('action'), {base: this.currentPath}));
-			//pass null for the update element argument; JFrame does our updating for us
-			var req = new Form.Request(form, null, {
-				//we don't want submission of the form to reset it on AJAX success;
-				//sometimes JFrame gets an error back in the html; JFrame will replace
-				//the form for us.
-				resetForm: false
-			});
-			this._setRequestOptions(req.request, {
-				onSuccess: function(nodes, elements, text){
-					this._requestSuccessHandler(req.request, text);
-				}.bind(this)
-			});
-		}, this);
-	}
-
-});

+ 2 - 1
desktop/core/static/js/Source/BehaviorFilters/Behavior.HtmlTableMultiSelectMenu.js

@@ -56,8 +56,9 @@ Behavior.addGlobalPlugin('HtmlTable', 'HtmlTableMutiSelect', function(element, m
 					return trMenu;
 				}).clean();
 			} else {
+				if (row.hasDataFilter('ContextMenu')) tableMenu.disable();
 				//otherwise, if there aren't multiple rows selected, disable the table's menu
-				tableMenu.disable();
+				else tableMenu.enable();
 			}
 		});
 	}

+ 17 - 10
desktop/core/static/js/Source/CCS/CCS.Desktop.Config.js

@@ -17,11 +17,18 @@
 ---
 description: Desktop Configuration
 provides: [CCS.Desktop.Config]
-requires: [/CCS.Desktop, clientcide/StickyWin.Drag]
+requires: [/CCS.Desktop, clientcide/StickyWin.Drag, Widgets/ART.Popup, Widgets/ART.Glyphs, Core/Selectors, More/HtmlTable.Select]
 script: CCS.Desktop.Config.js
 
 ...
 */
+
+HtmlTable.implement({
+	options: {
+		classNoSort: 'noSort'
+	}
+});
+
 //by default, make all StickyWin instances load inside of div#ccs-desktop
 StickyWin.implement({
 	options: {
@@ -176,14 +183,14 @@ Selectors.Pseudo.widget = function() { return this.get && (!! this.get("widget")
 //Although implement checks for a pre-existing implementation of the method, it has to be forced for IE to overwrite the MooTools version.
 //Thus, the IE check.
 if (Browser.Engine.trident) {
-        Array.implement({
-                forEach: function(fn, bind){
-                        var len = this.length;
-                        for (var i=0; i < len; i++) {
-                                if(i in this) fn.call(bind, this[i], i, this);
-                        }
-                }       
-        }, true);
+	Array.implement({
+		forEach: function(fn, bind){
+			var len = this.length;
+			for (var i=0; i < len; i++) {
+				if(i in this) fn.call(bind, this[i], i, this);
+			}
+		}       
+	}, true);
 
-        Array.alias('forEach', 'each', true); 
+	Array.alias('forEach', 'each', true); 
 }

+ 1 - 1
ext/thirdparty/js/art-widgets.hash

@@ -1 +1 @@
-a55bab170a37fb0f855a8d291460ce7a07dc92f3
+1e84c9987aca61b74b3c0458fedfcb99a6a1bef8