address button comment and jshint errors
authorGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 11 Jun 2014 20:29:07 +0000 (16:29 -0400)
committerGil Moskowitz <gmoskowitz@xtuple.com>
Wed, 11 Jun 2014 20:29:07 +0000 (16:29 -0400)
lib/enyo-x/source/views/grid_box.js
lib/enyo-x/source/views/workspace.js
node-datasource/routes/export.js

index 94be832..1d55fee 100644 (file)
@@ -352,7 +352,8 @@ trailing:true, white:true, strict: false*/
         classes: "xv-buttons",
         components: [
           {kind: "onyx.Button", name: "newButton", ontap: "newItem", classes: "icon-plus"},
-          {kind: "font.TextIcon", name: "exportButton", ontap: "exportAttr", icon: "share", content: "_export".loc()} // TODO: classes?
+          {kind: "onyx.Button", name: "exportButton", ontap: "exportAttr",
+           icon: "share", content: "_export".loc(), classes: "icon-share"}
         ]
       });
 
@@ -528,8 +529,8 @@ trailing:true, white:true, strict: false*/
       editor.render();
       editor.setFirstFocus();
     },
-    exportAttr: function(inSender, inEvent) {
-      var gridbox = inEvent.originator.parent.parent.parent;
+    exportAttr: function (inSender, inEvent) {
+      var gridbox = inEvent.originator.parent.parent;
       this.doExportAttr({ recordType: gridbox.parent.parent.model,
                           uuid:       gridbox.parent.parent.value.attributes.uuid,
                           attr:       gridbox.attr });
index 463f4e9..849c58a 100644 (file)
@@ -1061,9 +1061,8 @@ trailing:true, white:true, strict: false*/
 
     // export just one attribute of the model displayed by the workspace
     openExportTab: function (routeName, recordType, id, attr) {
-      console.log('workspace exportAttr ' + recordType + '/' + attr + '(' + id + ')');
-      var query = { parameters: [{ attribute: "uuid", value: id }]
-                  , details: { attr: attr }
+      var query = { parameters: [{ attribute: "uuid", value: id }],
+                    details: { attr: attr }
       };
       // sending the locale information back over the wire saves a call to the db
       window.open(XT.getOrganizationPath() +
index 831497e..6312135 100644 (file)
@@ -151,17 +151,17 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
         var resultAsCsv,
           filename = "export",
           type,
-          number = result.data && result.data.data && result.data.data[0]
-                && (result.data.data[0].number || result.data.data[0].name),
-          attr = requestDetails.query
-              && requestDetails.query.details
-              && requestDetails.query.details.attr
+          number = result.data && result.data.data && result.data.data[0] &&
+                   (result.data.data[0].number || result.data.data[0].name),
+          attr = requestDetails.query &&
+                 requestDetails.query.details &&
+                 requestDetails.query.details.attr
           ;
         try {
           type = requestDetails.type;
-          filename = type.replace("ListItem", "Export")
-                   + (attr && number ? "-" + number : "")
-                   + (attr           ? "-" + attr   : "")
+          filename = type.replace("ListItem", "Export") +
+                     (attr && number ? "-" + number : "") +
+                     (attr           ? "-" + attr   : "")
                    ;
 
         } catch (error) {