1
1
/**
2
- * MapLoom - v1.0.0 - 2014-11-12
2
+ * MapLoom - v1.0.0 - 2014-12-04
3
3
* http://www.lmnsolutions.com
4
4
*
5
5
* Copyright (c) 2014 LMN Solutions
@@ -31233,8 +31233,6 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31233
31233
(function ($) {
31234
31234
31235
31235
var $document = $(document),
31236
- bsSort = [],
31237
- lastSort,
31238
31236
signClass;
31239
31237
31240
31238
$.bootstrapSortable = function (applyLast, sign) {
@@ -31247,13 +31245,16 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31247
31245
31248
31246
// set attributes needed for sorting
31249
31247
$('table.sortable').each(function () {
31250
- var $this = $(this);
31248
+ var $this = $(this),
31249
+ context = lookupSortContext($this),
31250
+ bsSort = context.bsSort;
31251
31251
applyLast = (applyLast === true);
31252
31252
$this.find('span.sign').remove();
31253
31253
$this.find('thead tr').each(function (rowIndex) {
31254
31254
var columnsSkipped = 0;
31255
31255
$(this).find('th').each(function (columnIndex) {
31256
31256
var $this = $(this);
31257
+ $this.addClass('nosort').removeClass('up down');
31257
31258
$this.attr('data-sortcolumn', columnIndex + columnsSkipped);
31258
31259
$this.attr('data-sortkey', columnIndex + '-' + rowIndex);
31259
31260
if ($this.attr("colspan") !== undefined) {
@@ -31263,7 +31264,7 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31263
31264
});
31264
31265
$this.find('td').each(function () {
31265
31266
var $this = $(this);
31266
- if ($this.attr('data-dateformat') != undefined && momentJsAvailable) {
31267
+ if ($this.attr('data-dateformat') !== undefined && momentJsAvailable) {
31267
31268
$this.attr('data-value', moment($this.text(), $this.attr('data-dateformat')).format('YYYY/MM/DD/HH/mm/ss'));
31268
31269
}
31269
31270
else {
@@ -31275,10 +31276,10 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31275
31276
var $sortTable = $this.closest('table.sortable');
31276
31277
$this.data('sortTable', $sortTable);
31277
31278
var sortKey = $this.attr('data-sortkey');
31278
- var thisLastSort = applyLast ? lastSort : -1;
31279
+ var thisLastSort = applyLast ? context. lastSort : -1;
31279
31280
bsSort[sortKey] = applyLast ? bsSort[sortKey] : $this.attr('data-defaultsort');
31280
- if (bsSort[sortKey] != null && (applyLast == (sortKey == thisLastSort))) {
31281
- bsSort[sortKey] = bsSort[sortKey] == 'asc' ? 'desc' : 'asc';
31281
+ if (bsSort[sortKey] !== undefined && (applyLast === (sortKey = == thisLastSort))) {
31282
+ bsSort[sortKey] = bsSort[sortKey] === 'asc' ? 'desc' : 'asc';
31282
31283
doSort($this, $sortTable);
31283
31284
}
31284
31285
});
@@ -31293,9 +31294,22 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31293
31294
$table.trigger('sorted');
31294
31295
});
31295
31296
31297
+ // Look up sorting data appropriate for the specified table (jQuery element).
31298
+ // This allows multiple tables on one page without collisions.
31299
+ function lookupSortContext($table) {
31300
+ var context = $table.data("bootstrap-sortable-context");
31301
+ if(context == null) {
31302
+ context = { bsSort: [], lastSort: null };
31303
+ $table.data("bootstrap-sortable-context", context);
31304
+ }
31305
+ return context;
31306
+ }
31307
+
31296
31308
//Sorting mechanism separated
31297
31309
function doSort($this, $table) {
31298
- var sortColumn = $this.attr('data-sortcolumn');
31310
+ var sortColumn = $this.attr('data-sortcolumn'),
31311
+ context = lookupSortContext($table),
31312
+ bsSort = context.bsSort;
31299
31313
31300
31314
var colspan = $this.attr('colspan');
31301
31315
if (colspan) {
@@ -31314,9 +31328,13 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31314
31328
var localSignClass = $this.attr('data-defaultsign') || signClass;
31315
31329
31316
31330
// update arrow icon
31331
+ $table.find('th').each(function() {
31332
+ $(this).removeClass('up').removeClass('down').addClass('nosort');
31333
+ });
31334
+
31317
31335
if ($.browser.mozilla) {
31318
31336
var moz_arrow = $table.find('div.mozilla');
31319
- if (moz_arrow != null ) {
31337
+ if (moz_arrow !== undefined ) {
31320
31338
moz_arrow.find('.sign').remove();
31321
31339
moz_arrow.parent().html(moz_arrow.html());
31322
31340
}
@@ -31330,15 +31348,25 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31330
31348
31331
31349
// sort direction
31332
31350
var sortKey = $this.attr('data-sortkey');
31333
- var initialDirection = $this.attr('data-firstsort') != 'desc' ? 'desc' : 'asc';
31351
+ var initialDirection = $this.attr('data-firstsort') !== 'desc' ? 'desc' : 'asc';
31334
31352
31335
- lastSort = sortKey;
31336
- bsSort[sortKey] = (bsSort[sortKey] || initialDirection) == 'asc' ? 'desc' : 'asc';
31337
- if (bsSort[sortKey] == 'desc') { $this.find('span.sign').addClass('up'); }
31353
+ context.lastSort = sortKey;
31354
+ bsSort[sortKey] = (bsSort[sortKey] || initialDirection) === 'asc' ? 'desc' : 'asc';
31355
+ if (bsSort[sortKey] === 'desc') {
31356
+ $this.find('span.sign').addClass('up');
31357
+ $this.addClass('up').removeClass('down nosort');
31358
+ } else {
31359
+ $this.addClass('down').removeClass('up nosort');
31360
+ }
31338
31361
31339
31362
// sort rows
31340
- var rows = $table.find ('tbody tr');
31363
+ var rows = $table.children ('tbody').children(' tr');
31341
31364
rows.tsort('td:eq(' + sortColumn + ')', { order: bsSort[sortKey], attr: 'data-value' });
31365
+
31366
+ // add class to sorted column cells
31367
+ $table.find('td.sorted, th.sorted').removeClass('sorted');
31368
+ rows.find('td:eq(' + sortColumn + ')').addClass('sorted');
31369
+ $this.addClass('sorted');
31342
31370
}
31343
31371
31344
31372
// jQuery 1.9 removed this object
@@ -31347,8 +31375,8 @@ return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,
31347
31375
var ua = navigator.userAgent;
31348
31376
$.each($.browser, function (c) {
31349
31377
$.browser[c] = ((new RegExp(c, 'i').test(ua))) ? true : false;
31350
- if ($.browser.mozilla && c == 'mozilla') { $.browser.mozilla = ((new RegExp('firefox', 'i').test(ua))) ? true : false; }
31351
- if ($.browser.chrome && c == 'safari') { $.browser.safari = false; }
31378
+ if ($.browser.mozilla && c === 'mozilla') { $.browser.mozilla = ((new RegExp('firefox', 'i').test(ua))) ? true : false; }
31379
+ if ($.browser.chrome && c === 'safari') { $.browser.safari = false; }
31352
31380
});
31353
31381
}
31354
31382
@@ -35559,14 +35587,17 @@ var DiffColorMap = {
35559
35587
return selectedItem_;
35560
35588
};
35561
35589
this.getSelectedItemPics = function () {
35562
- var picStrings = [];
35563
- goog.array.forEach(selectedItemPics_.pics, function (item, index) {
35564
- if (goog.isObject(item)) {
35565
- picStrings[index] = item.modified;
35566
- } else {
35567
- picStrings[index] = item;
35568
- }
35569
- });
35590
+ var picStrings = null;
35591
+ if (goog.isDefAndNotNull(selectedItemPics_)) {
35592
+ picStrings = [];
35593
+ goog.array.forEach(selectedItemPics_.pics, function (item, index) {
35594
+ if (goog.isObject(item)) {
35595
+ picStrings[index] = item.modified;
35596
+ } else {
35597
+ picStrings[index] = item;
35598
+ }
35599
+ });
35600
+ }
35570
35601
return picStrings;
35571
35602
};
35572
35603
this.getSelectedItemProperties = function () {
0 commit comments