projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #8101 from colemanw/CRM-18379
[civicrm-core.git]
/
js
/
jquery
/
jquery.dashboard.js
diff --git
a/js/jquery/jquery.dashboard.js
b/js/jquery/jquery.dashboard.js
index 44bef065ba6d0cae6411016239b001d7996bee9f..d1f68bb4e16badc3d23e99def5a6048643ba2cf8 100644
(file)
--- a/
js/jquery/jquery.dashboard.js
+++ b/
js/jquery/jquery.dashboard.js
@@
-2,7
+2,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
5
|
+ | Copyright CiviCRM LLC (c) 2004-201
6
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-36,8
+36,11
@@
* Draggable
* UI Core
*
* Draggable
* UI Core
*
+ * NOTE: This file is viewed as "legacy" and shouldn't be used to
+ * develop new functionality. Its lint problems are grandfathered
+ * (although if someone wants to cleanup+test, please feel welcome).
*/
*/
-
+/* jshint ignore:start */
(function($) { // Create closure.
// Constructor for dashboard object.
$.fn.dashboard = function(options) {
(function($) { // Create closure.
// Constructor for dashboard object.
$.fn.dashboard = function(options) {
@@
-78,19
+81,19
@@
var params = {};
// For each column...
var params = {};
// For each column...
- for (var c in dashboard.columns) {
+ for (var c
2
in dashboard.columns) {
// IDs of the sortable elements in this column.
// IDs of the sortable elements in this column.
-
if( typeof dashboard.columns[c] == 'object' ) var ids = dashboard.columns[c].element.sortable('toArray')
;
+
var ids = (typeof dashboard.columns[c2] == 'object') ? dashboard.columns[c2].element.sortable('toArray') : undefined
;
// For each id...
for (var w in ids) {
// Chop 'widget-' off of the front so that we have the real widget id.
// For each id...
for (var w in ids) {
// Chop 'widget-' off of the front so that we have the real widget id.
-
if( typeof ids[w] == 'string' ) var id = ids[w].substring('widget-'.length)
;
+
var id = (typeof ids[w] == 'string') ? ids[w].substring('widget-'.length) : undefined
;
// Add one flat property to the params object that will look like an array element to the PHP server.
// Unfortunately jQuery doesn't do this for us.
// Add one flat property to the params object that will look like an array element to the PHP server.
// Unfortunately jQuery doesn't do this for us.
- if ( typeof dashboard.widgets[id] == 'object' ) params['columns[' + c + '][' + id + ']'] = (dashboard.widgets[id].minimized ? '1' : '0');
+ if ( typeof dashboard.widgets[id] == 'object' ) params['columns[' + c
2
+ '][' + id + ']'] = (dashboard.widgets[id].minimized ? '1' : '0');
}
}
}
}
@@
-266,7
+269,7
@@
// Callback for when a user starts resorting a list. Hides all the empty placeholders.
function hideEmptyPlaceholders(e, ui) {
for (var c in dashboard.columns) {
// Callback for when a user starts resorting a list. Hides all the empty placeholders.
function hideEmptyPlaceholders(e, ui) {
for (var c in dashboard.columns) {
- if(
typeof dashboard.columns[c] == 'object
' ) dashboard.columns[c].emptyPlaceholder.hide();
+ if(
(typeof dashboard.columns[c]) == 'object
' ) dashboard.columns[c].emptyPlaceholder.hide();
}
}
}
}
@@
-306,14
+309,14
@@
};
widget.minimize = function() {
$('.widget-content', widget.element).slideUp(opts.animationSpeed);
};
widget.minimize = function() {
$('.widget-content', widget.element).slideUp(opts.animationSpeed);
- $(widget.controls.minimize.element).addClass( '
maximize-icon
' );
- $(widget.controls.minimize.element).removeClass( '
minimize-ico
n' );
+ $(widget.controls.minimize.element).addClass( '
fa-caret-right
' );
+ $(widget.controls.minimize.element).removeClass( '
fa-caret-dow
n' );
widget.minimized = true;
};
widget.maximize = function() {
$('.widget-content', widget.element).slideDown(opts.animationSpeed);
widget.minimized = true;
};
widget.maximize = function() {
$('.widget-content', widget.element).slideDown(opts.animationSpeed);
- $(widget.controls.minimize.element).removeClass( '
maximize-icon
' );
- $(widget.controls.minimize.element).addClass( '
minimize-ico
n' );
+ $(widget.controls.minimize.element).removeClass( '
fa-caret-right
' );
+ $(widget.controls.minimize.element).addClass( '
fa-caret-dow
n' );
widget.minimized = false;
};
widget.minimized = false;
};
@@
-422,7
+425,7
@@
// Adds controls to a widget. id is for internal use and image file name in images/dashboard/ (a .gif).
widget.addControl = function(id, control) {
// Adds controls to a widget. id is for internal use and image file name in images/dashboard/ (a .gif).
widget.addControl = function(id, control) {
- var markup = '<a class="
widget-icon ' + id + '-icon
" alt="' + control.description + '" title="' + control.description + '"></a>';
+ var markup = '<a class="
crm-i ' + control.icon + '
" alt="' + control.description + '" title="' + control.description + '"></a>';
control.element = $(markup).prependTo($('.widget-controls', widget.element)).click(control.callback);
};
control.element = $(markup).prependTo($('.widget-controls', widget.element)).click(control.callback);
};
@@
-453,19
+456,23
@@
widget.controls = {
settings: {
description: ts('Configure this dashlet'),
widget.controls = {
settings: {
description: ts('Configure this dashlet'),
- callback: widget.toggleSettings
+ callback: widget.toggleSettings,
+ icon: 'fa-wrench'
},
minimize: {
description: ts('Collapse or expand'),
},
minimize: {
description: ts('Collapse or expand'),
- callback: widget.toggleMinimize
+ callback: widget.toggleMinimize,
+ icon: 'fa-caret-down',
},
fullscreen: {
description: ts('View fullscreen'),
},
fullscreen: {
description: ts('View fullscreen'),
- callback: widget.enterFullscreen
+ callback: widget.enterFullscreen,
+ icon: 'fa-expand',
},
close: {
description: ts('Remove from dashboard'),
},
close: {
description: ts('Remove from dashboard'),
- callback: widget.remove
+ callback: widget.remove,
+ icon: 'fa-times'
}
};
// End public properties of widget.
}
};
// End public properties of widget.