hooch 0.15.14 → 0.15.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c86e52581ab5864e003e394b4365d8141830277
4
- data.tar.gz: 24ef5090304321742fcf6d058d015867b1ea67d4
3
+ metadata.gz: 7b50e84afb6d186aa2cf8db7b525e79918ebf060
4
+ data.tar.gz: ce1666a61576f30ba62995ff2877836b689240b7
5
5
  SHA512:
6
- metadata.gz: 250956af0af882d5dd606c4e004adef18ab6234a6b1b546cc3b466f5ed285c1cff9c86b3b14814495ac189877ab458d18a6e6f3aff2bd692e842033281bd00fc
7
- data.tar.gz: fa08557dee5e287806320da5535a4f841b490abeff8bf4850dfd574c663c23690fd2251af6519e1bb8a568c105cae74023c2ab12cc483aad31c1a0e9d19cee34
6
+ metadata.gz: 331549a266b62671d58d5be7561891538549e8d3423cd133f50423846779c28e8e5de80f87585d566051ae5cf5cf86025fef93fda3012eb49839e691840f20a3
7
+ data.tar.gz: 4069107eadb0b83dbfc03ed636779a26975dfe7e854ec13e50e7587bb77cbb5f9ee90e7f0a40bfca546674979763d4a4c0d92d9878b7d0e71733d0e3025b3c72
@@ -524,6 +524,9 @@ var initHooch = function(){
524
524
  tab_group.tab_triggers.push(new_tab);
525
525
  tab_group.tab_triggers_by_id[new_tab.tab_id] = new_tab;
526
526
  })
527
+ if(this.tab_triggers.length == 0){
528
+ console.log("WARNING: hooch could not find any tab triggers for the tab set named '" + this.name + "'")
529
+ }
527
530
  },
528
531
  getTabByPushState: function(state_value){
529
532
  var selected_tab = null;
@@ -541,9 +544,14 @@ var initHooch = function(){
541
544
  this.$content_parent = this.tab_triggers[0].getParent();
542
545
  },
543
546
  handleDefault: function(){
544
- if(this.$tab_group.data('default-tab')){
545
- this.default_tab = this.tab_triggers_by_id[this.$tab_group.data('default-tab')];
546
- this.default_tab.toggleTarget(this.state_behavior);
547
+ var default_tab_name = this.$tab_group.data('default-tab')
548
+ if(default_tab_name){
549
+ this.default_tab = this.tab_triggers_by_id[default_tab_name];
550
+ if(!this.default_tab){
551
+ console.log("WARNING: hooch could not find the tab " + default_tab_name + " for tab set " + this.name)
552
+ } else {
553
+ this.default_tab.toggleTarget(this.state_behavior);
554
+ }
547
555
  }
548
556
  },
549
557
  hideAll: function(trigger){
@@ -1461,11 +1469,34 @@ var initHooch = function(){
1461
1469
  this.refreshGrid();
1462
1470
  }
1463
1471
  },
1472
+ getProgressTarget: function(){
1473
+ if(this.$progress_target) return
1474
+ if(this.$sorter.data('progress-target')){
1475
+ this.$progress_target = $(this.$sorter.data('progress-target'))
1476
+ }
1477
+ },
1478
+ startProgressIndicator: function(){
1479
+ this.getProgressTarget()
1480
+ if(this.$progress_target){
1481
+ this.progress_indicator = new thin_man.AjaxProgress(this.$progress_target,this.$sorter,'black')
1482
+ }
1483
+ },
1484
+ stopProgressIndicator: function(){
1485
+ if(this.progress_indicator){
1486
+ this.progress_indicator.stop()
1487
+ delete this.progress_indicator
1488
+ }
1489
+ },
1464
1490
  sendSort: function(){
1491
+ this.startProgressIndicator()
1492
+ var sorter = this
1465
1493
  $.ajax({
1466
1494
  url: this.$sorter.attr('href'),
1467
1495
  method: 'PATCH',
1468
- data: this.getFormData()
1496
+ data: this.getFormData(),
1497
+ complete: function(jqXHR) {
1498
+ sorter.stopProgressIndicator()
1499
+ }
1469
1500
  })
1470
1501
  },
1471
1502
  getFormData: function(){
@@ -1,6 +1,11 @@
1
1
  module Hooch
2
2
  module HoochHelper
3
3
  def tab_set(name, type: nil, default_tab: nil, no_history: nil, preload_tabs: nil)
4
+ if params[name].present?
5
+ default_tab = params[name]
6
+ else
7
+ default_tab = default_tab
8
+ end
4
9
  if :ajax == type
5
10
  type = 'AjaxTabGroup'
6
11
  end
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.15.14"
2
+ VERSION = "0.15.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.14
4
+ version: 0.15.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-25 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails