semantic-ui-sass 1.8.1.0 → 1.11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.otf +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +526 -465
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/javascripts/semantic-ui/accordion.js +63 -43
- data/app/assets/javascripts/semantic-ui/api.js +38 -18
- data/app/assets/javascripts/semantic-ui/checkbox.js +6 -4
- data/app/assets/javascripts/semantic-ui/colorize.js +3 -3
- data/app/assets/javascripts/semantic-ui/dimmer.js +57 -15
- data/app/assets/javascripts/semantic-ui/dropdown.js +65 -27
- data/app/assets/javascripts/semantic-ui/form.js +108 -29
- data/app/assets/javascripts/semantic-ui/modal.js +31 -31
- data/app/assets/javascripts/semantic-ui/nag.js +4 -4
- data/app/assets/javascripts/semantic-ui/popup.js +74 -37
- data/app/assets/javascripts/semantic-ui/progress.js +4 -4
- data/app/assets/javascripts/semantic-ui/rating.js +4 -4
- data/app/assets/javascripts/semantic-ui/search.js +67 -26
- data/app/assets/javascripts/semantic-ui/shape.js +4 -4
- data/app/assets/javascripts/semantic-ui/sidebar.js +22 -17
- data/app/assets/javascripts/semantic-ui/site.js +3 -3
- data/app/assets/javascripts/semantic-ui/state.js +30 -25
- data/app/assets/javascripts/semantic-ui/sticky.js +89 -72
- data/app/assets/javascripts/semantic-ui/tab.js +37 -22
- data/app/assets/javascripts/semantic-ui/transition.js +163 -61
- data/app/assets/javascripts/semantic-ui/video.js +4 -4
- data/app/assets/javascripts/semantic-ui/visibility.js +186 -124
- data/app/assets/javascripts/semantic-ui/visit.js +6 -4
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +6 -7
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +56 -40
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +100 -45
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +28 -16
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +8 -7
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +11 -11
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +5 -8
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +11 -4
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +34 -10
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +391 -51
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +18 -5
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +33 -49
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +47 -14
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +7 -8
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +10 -5
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +52 -7
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +20 -7
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +31 -13
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +9 -8
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +21 -9
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +6 -17
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +15 -11
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +161 -323
- data/app/assets/stylesheets/semantic-ui/modules/_video.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +202 -51
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +10 -12
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +5 -6
- data/lib/semantic/ui/sass/version.rb +2 -2
- metadata +3 -4
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - State
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - State
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
;(function ( $, window, document, undefined ) {
|
13
13
|
|
14
|
+
"use strict";
|
15
|
+
|
14
16
|
$.fn.state = function(parameters) {
|
15
17
|
var
|
16
18
|
$allModules = $(this),
|
@@ -192,13 +194,20 @@ $.fn.state = function(parameters) {
|
|
192
194
|
toggle: {
|
193
195
|
state: function() {
|
194
196
|
var
|
195
|
-
apiRequest
|
197
|
+
apiRequest,
|
198
|
+
requestCancelled
|
196
199
|
;
|
197
200
|
if( module.allows('active') && module.is.enabled() ) {
|
198
201
|
module.refresh();
|
199
202
|
if($.fn.api !== undefined) {
|
200
|
-
apiRequest
|
201
|
-
|
203
|
+
apiRequest = $module.api('get request');
|
204
|
+
requestCancelled = $module.api('was cancelled');
|
205
|
+
if( requestCancelled ) {
|
206
|
+
module.debug('API Request cancelled by beforesend');
|
207
|
+
settings.activateTest = function(){ return false; };
|
208
|
+
settings.deactivateTest = function(){ return false; };
|
209
|
+
}
|
210
|
+
else if(apiRequest) {
|
202
211
|
module.listenTo(apiRequest);
|
203
212
|
return;
|
204
213
|
}
|
@@ -230,11 +239,6 @@ $.fn.state = function(parameters) {
|
|
230
239
|
})
|
231
240
|
;
|
232
241
|
}
|
233
|
-
// xhr exists but set to false, beforeSend killed the xhr
|
234
|
-
else {
|
235
|
-
settings.activateTest = function(){ return false; };
|
236
|
-
settings.deactivateTest = function(){ return false; };
|
237
|
-
}
|
238
242
|
},
|
239
243
|
|
240
244
|
// checks whether active/inactive state can be given
|
@@ -394,7 +398,7 @@ $.fn.state = function(parameters) {
|
|
394
398
|
}
|
395
399
|
}
|
396
400
|
else {
|
397
|
-
module.debug('Text is already
|
401
|
+
module.debug('Text is already set, ignoring update', text);
|
398
402
|
}
|
399
403
|
}
|
400
404
|
},
|
@@ -563,7 +567,7 @@ $.fn.state = function(parameters) {
|
|
563
567
|
}
|
564
568
|
else {
|
565
569
|
if(instance !== undefined) {
|
566
|
-
|
570
|
+
instance.invoke('destroy');
|
567
571
|
}
|
568
572
|
module.initialize();
|
569
573
|
}
|
@@ -579,37 +583,37 @@ $.fn.state = function(parameters) {
|
|
579
583
|
$.fn.state.settings = {
|
580
584
|
|
581
585
|
// module info
|
582
|
-
name
|
586
|
+
name : 'State',
|
583
587
|
|
584
588
|
// debug output
|
585
|
-
debug
|
589
|
+
debug : false,
|
586
590
|
|
587
591
|
// verbose debug output
|
588
|
-
verbose
|
592
|
+
verbose : true,
|
589
593
|
|
590
594
|
// namespace for events
|
591
|
-
namespace
|
595
|
+
namespace : 'state',
|
592
596
|
|
593
597
|
// debug data includes performance
|
594
|
-
performance: true,
|
598
|
+
performance : true,
|
595
599
|
|
596
600
|
// callback occurs on state change
|
597
|
-
onActivate
|
598
|
-
onDeactivate
|
599
|
-
onChange
|
601
|
+
onActivate : function() {},
|
602
|
+
onDeactivate : function() {},
|
603
|
+
onChange : function() {},
|
600
604
|
|
601
605
|
// state test functions
|
602
606
|
activateTest : function() { return true; },
|
603
607
|
deactivateTest : function() { return true; },
|
604
608
|
|
605
609
|
// whether to automatically map default states
|
606
|
-
automatic
|
610
|
+
automatic : true,
|
607
611
|
|
608
612
|
// activate / deactivate changes all elements instantiated at same time
|
609
|
-
sync
|
613
|
+
sync : false,
|
610
614
|
|
611
615
|
// default flash text duration, used for temporarily changing text of an element
|
612
|
-
flashDuration
|
616
|
+
flashDuration : 1000,
|
613
617
|
|
614
618
|
// selector filter
|
615
619
|
filter : {
|
@@ -621,7 +625,8 @@ $.fn.state.settings = {
|
|
621
625
|
|
622
626
|
// error
|
623
627
|
error: {
|
624
|
-
|
628
|
+
beforeSend : 'The before send function has cancelled state change',
|
629
|
+
method : 'The method you called is not defined.'
|
625
630
|
},
|
626
631
|
|
627
632
|
// metadata
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Sticky
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Sticky
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributorss
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -30,7 +30,9 @@ $.fn.sticky = function(parameters) {
|
|
30
30
|
$allModules
|
31
31
|
.each(function() {
|
32
32
|
var
|
33
|
-
settings =
|
33
|
+
settings = ( $.isPlainObject(parameters) )
|
34
|
+
? $.extend(true, {}, $.fn.sticky.settings, parameters)
|
35
|
+
: $.extend({}, $.fn.sticky.settings),
|
34
36
|
|
35
37
|
className = settings.className,
|
36
38
|
namespace = settings.namespace,
|
@@ -62,37 +64,17 @@ $.fn.sticky = function(parameters) {
|
|
62
64
|
module = {
|
63
65
|
|
64
66
|
initialize: function() {
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
else {
|
69
|
-
$context = $container;
|
70
|
-
}
|
71
|
-
if($context.length === 0) {
|
72
|
-
module.error(error.invalidContext, settings.context, $module);
|
73
|
-
return;
|
74
|
-
}
|
67
|
+
|
68
|
+
module.determineContext();
|
75
69
|
module.verbose('Initializing sticky', settings, $container);
|
70
|
+
|
76
71
|
module.save.positions();
|
72
|
+
module.checkErrors();
|
73
|
+
module.bind.events();
|
77
74
|
|
78
|
-
|
79
|
-
|
80
|
-
module.error(error.visible, $module);
|
81
|
-
}
|
82
|
-
if(module.cache.element.height > module.cache.context.height) {
|
83
|
-
module.reset();
|
84
|
-
module.error(error.elementSize, $module);
|
85
|
-
return;
|
75
|
+
if(settings.observeChanges) {
|
76
|
+
module.observeChanges();
|
86
77
|
}
|
87
|
-
|
88
|
-
$window
|
89
|
-
.on('resize' + eventNamespace, module.event.resize)
|
90
|
-
;
|
91
|
-
$scroll
|
92
|
-
.on('scroll' + eventNamespace, module.event.scroll)
|
93
|
-
;
|
94
|
-
|
95
|
-
module.observeChanges();
|
96
78
|
module.instantiate();
|
97
79
|
},
|
98
80
|
|
@@ -110,40 +92,63 @@ $.fn.sticky = function(parameters) {
|
|
110
92
|
if(observer) {
|
111
93
|
observer.disconnect();
|
112
94
|
}
|
113
|
-
$window
|
114
|
-
|
115
|
-
;
|
116
|
-
$scroll
|
117
|
-
.off('scroll' + eventNamespace, module.event.scroll)
|
118
|
-
;
|
119
|
-
$module
|
120
|
-
.removeData(moduleNamespace)
|
121
|
-
;
|
95
|
+
$window.off('resize' + eventNamespace, module.event.resize);
|
96
|
+
$scroll.off('scroll' + eventNamespace, module.event.scroll);
|
97
|
+
$module.removeData(moduleNamespace);
|
122
98
|
},
|
123
99
|
|
124
100
|
observeChanges: function() {
|
125
101
|
var
|
126
102
|
context = $context[0]
|
127
103
|
;
|
128
|
-
if(
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
module.
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
104
|
+
if('MutationObserver' in window) {
|
105
|
+
observer = new MutationObserver(function(mutations) {
|
106
|
+
clearTimeout(module.timer);
|
107
|
+
module.timer = setTimeout(function() {
|
108
|
+
module.verbose('DOM tree modified, updating sticky menu');
|
109
|
+
module.refresh();
|
110
|
+
}, 20);
|
111
|
+
});
|
112
|
+
observer.observe(element, {
|
113
|
+
childList : true,
|
114
|
+
subtree : true
|
115
|
+
});
|
116
|
+
observer.observe(context, {
|
117
|
+
childList : true,
|
118
|
+
subtree : true
|
119
|
+
});
|
120
|
+
module.debug('Setting up mutation observer', observer);
|
121
|
+
}
|
122
|
+
},
|
123
|
+
|
124
|
+
determineContext: function() {
|
125
|
+
if(settings.context) {
|
126
|
+
$context = $(settings.context);
|
127
|
+
}
|
128
|
+
else {
|
129
|
+
$context = $container;
|
130
|
+
}
|
131
|
+
if($context.length === 0) {
|
132
|
+
module.error(error.invalidContext, settings.context, $module);
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
},
|
136
|
+
|
137
|
+
checkErrors: function() {
|
138
|
+
if( module.is.hidden() ) {
|
139
|
+
module.error(error.visible, $module);
|
140
|
+
}
|
141
|
+
if(module.cache.element.height > module.cache.context.height) {
|
142
|
+
module.reset();
|
143
|
+
module.error(error.elementSize, $module);
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
},
|
147
|
+
|
148
|
+
bind: {
|
149
|
+
events: function() {
|
150
|
+
$window.on('resize' + eventNamespace, module.event.resize);
|
151
|
+
$scroll.on('scroll' + eventNamespace, module.event.scroll);
|
147
152
|
}
|
148
153
|
},
|
149
154
|
|
@@ -178,9 +183,7 @@ $.fn.sticky = function(parameters) {
|
|
178
183
|
$element = $('<div/>'),
|
179
184
|
element = $element.get()
|
180
185
|
;
|
181
|
-
$element
|
182
|
-
.addClass(className.supported)
|
183
|
-
;
|
186
|
+
$element.addClass(className.supported);
|
184
187
|
return($element.css('position').match('sticky'));
|
185
188
|
}
|
186
189
|
},
|
@@ -204,8 +207,9 @@ $.fn.sticky = function(parameters) {
|
|
204
207
|
height : $module.outerHeight()
|
205
208
|
},
|
206
209
|
context = {
|
207
|
-
offset: $context.offset(),
|
208
|
-
height: $context.outerHeight()
|
210
|
+
offset : $context.offset(),
|
211
|
+
height : $context.outerHeight(),
|
212
|
+
bottomPadding : parseInt($context.css('padding-bottom'), 10)
|
209
213
|
}
|
210
214
|
;
|
211
215
|
module.cache = {
|
@@ -222,9 +226,10 @@ $.fn.sticky = function(parameters) {
|
|
222
226
|
bottom : element.offset.top + element.height
|
223
227
|
},
|
224
228
|
context: {
|
225
|
-
top
|
226
|
-
height
|
227
|
-
|
229
|
+
top : context.offset.top,
|
230
|
+
height : context.height,
|
231
|
+
bottomPadding : context.bottomPadding,
|
232
|
+
bottom : context.offset.top + context.height - context.bottomPadding
|
228
233
|
}
|
229
234
|
};
|
230
235
|
module.set.containerSize();
|
@@ -309,7 +314,11 @@ $.fn.sticky = function(parameters) {
|
|
309
314
|
}
|
310
315
|
else {
|
311
316
|
module.debug('Settings container size', module.cache.context.height);
|
312
|
-
$container.height(module.cache.context.height)
|
317
|
+
if( Math.abs($container.height() - module.cache.context.height) > 5) {
|
318
|
+
$container.css({
|
319
|
+
height: module.cache.context.height
|
320
|
+
});
|
321
|
+
}
|
313
322
|
}
|
314
323
|
},
|
315
324
|
scroll: function(scroll) {
|
@@ -388,7 +397,12 @@ $.fn.sticky = function(parameters) {
|
|
388
397
|
if(elementVisible) {
|
389
398
|
|
390
399
|
if( module.is.initialPosition() ) {
|
391
|
-
if(scroll.top >=
|
400
|
+
if(scroll.top >= context.bottom) {
|
401
|
+
console.log(scroll.top, context.bottom);
|
402
|
+
module.debug('Element bottom of container');
|
403
|
+
module.bindBottom();
|
404
|
+
}
|
405
|
+
else if(scroll.top >= element.top) {
|
392
406
|
module.debug('Element passed, fixing element to page');
|
393
407
|
module.fixTop();
|
394
408
|
}
|
@@ -454,7 +468,7 @@ $.fn.sticky = function(parameters) {
|
|
454
468
|
$module
|
455
469
|
.css('left' , '')
|
456
470
|
.css('top' , '')
|
457
|
-
.css('bottom' , '')
|
471
|
+
.css('margin-bottom' , '')
|
458
472
|
.removeClass(className.fixed)
|
459
473
|
.removeClass(className.bottom)
|
460
474
|
.addClass(className.bound)
|
@@ -469,7 +483,7 @@ $.fn.sticky = function(parameters) {
|
|
469
483
|
$module
|
470
484
|
.css('left' , '')
|
471
485
|
.css('top' , '')
|
472
|
-
.css('bottom' ,
|
486
|
+
.css('margin-bottom' , module.cache.context.bottomPadding)
|
473
487
|
.removeClass(className.fixed)
|
474
488
|
.removeClass(className.top)
|
475
489
|
.addClass(className.bound)
|
@@ -490,6 +504,7 @@ $.fn.sticky = function(parameters) {
|
|
490
504
|
module.set.offset();
|
491
505
|
$module
|
492
506
|
.css('left', module.cache.element.left)
|
507
|
+
.css('bottom' , '')
|
493
508
|
.removeClass(className.bound)
|
494
509
|
.removeClass(className.bottom)
|
495
510
|
.addClass(className.fixed)
|
@@ -503,6 +518,7 @@ $.fn.sticky = function(parameters) {
|
|
503
518
|
module.set.offset();
|
504
519
|
$module
|
505
520
|
.css('left', module.cache.element.left)
|
521
|
+
.css('bottom' , '')
|
506
522
|
.removeClass(className.bound)
|
507
523
|
.removeClass(className.top)
|
508
524
|
.addClass(className.fixed)
|
@@ -717,7 +733,7 @@ $.fn.sticky = function(parameters) {
|
|
717
733
|
}
|
718
734
|
else {
|
719
735
|
if(instance !== undefined) {
|
720
|
-
|
736
|
+
instance.invoke('destroy');
|
721
737
|
}
|
722
738
|
module.initialize();
|
723
739
|
}
|
@@ -742,6 +758,7 @@ $.fn.sticky.settings = {
|
|
742
758
|
pushing : false,
|
743
759
|
context : false,
|
744
760
|
scrollContext : window,
|
761
|
+
|
745
762
|
offset : 0,
|
746
763
|
bottomOffset : 0,
|
747
764
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Tab
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Tab
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributorss
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -75,10 +75,7 @@ $.fn.tab = function(parameters) {
|
|
75
75
|
|
76
76
|
// set up automatic routing
|
77
77
|
if(settings.auto) {
|
78
|
-
module.
|
79
|
-
settings.apiSettings = {
|
80
|
-
url: settings.path + '/{$tab}'
|
81
|
-
};
|
78
|
+
module.set.auto();
|
82
79
|
}
|
83
80
|
|
84
81
|
// attach events if navigation wasn't set to window
|
@@ -238,6 +235,22 @@ $.fn.tab = function(parameters) {
|
|
238
235
|
},
|
239
236
|
|
240
237
|
set: {
|
238
|
+
auto: function() {
|
239
|
+
var
|
240
|
+
url = (typeof settings.path == 'string')
|
241
|
+
? settings.path.replace(/\/$/, '') + '/{$tab}'
|
242
|
+
: '/{$tab}'
|
243
|
+
;
|
244
|
+
module.verbose('Setting up automatic tab retrieval from server', url);
|
245
|
+
if($.isPlainObject(settings.apiSettings)) {
|
246
|
+
settings.apiSettings.url = url;
|
247
|
+
}
|
248
|
+
else {
|
249
|
+
settings.apiSettings = {
|
250
|
+
url: url
|
251
|
+
};
|
252
|
+
}
|
253
|
+
},
|
241
254
|
state: function(state) {
|
242
255
|
$.address.value(state);
|
243
256
|
}
|
@@ -270,10 +283,10 @@ $.fn.tab = function(parameters) {
|
|
270
283
|
;
|
271
284
|
module.verbose('Looking for tab', tab);
|
272
285
|
if(isTab) {
|
273
|
-
module.verbose('Tab was found', tab);
|
274
286
|
|
287
|
+
module.verbose('Tab was found', tab);
|
275
288
|
// scope up
|
276
|
-
activeTabPath
|
289
|
+
activeTabPath = currentPath;
|
277
290
|
parameterArray = module.utilities.filterArray(pathArray, currentPathArray);
|
278
291
|
|
279
292
|
if(isLastIndex) {
|
@@ -341,11 +354,11 @@ $.fn.tab = function(parameters) {
|
|
341
354
|
|
342
355
|
fetch: function(tabPath, fullTabPath) {
|
343
356
|
var
|
344
|
-
$tab
|
345
|
-
apiSettings
|
346
|
-
dataType
|
347
|
-
|
348
|
-
onSuccess
|
357
|
+
$tab = module.get.tabElement(tabPath),
|
358
|
+
apiSettings = {
|
359
|
+
dataType : 'html',
|
360
|
+
on : 'now',
|
361
|
+
onSuccess : function(response) {
|
349
362
|
module.cache.add(fullTabPath, response);
|
350
363
|
module.content.update(tabPath, response);
|
351
364
|
if(tabPath == activeTabPath) {
|
@@ -360,7 +373,7 @@ $.fn.tab = function(parameters) {
|
|
360
373
|
},
|
361
374
|
urlData: { tab: fullTabPath }
|
362
375
|
},
|
363
|
-
request = $tab.
|
376
|
+
request = $tab.api('get request') || false,
|
364
377
|
existingRequest = ( request && request.state() === 'pending' ),
|
365
378
|
requestSettings,
|
366
379
|
cachedContent
|
@@ -369,22 +382,24 @@ $.fn.tab = function(parameters) {
|
|
369
382
|
fullTabPath = fullTabPath || tabPath;
|
370
383
|
cachedContent = module.cache.read(fullTabPath);
|
371
384
|
|
385
|
+
|
386
|
+
module.activate.tab(tabPath);
|
387
|
+
|
372
388
|
if(settings.cache && cachedContent) {
|
373
389
|
module.debug('Showing existing content', fullTabPath);
|
374
390
|
module.content.update(tabPath, cachedContent);
|
375
|
-
module.activate.tab(tabPath);
|
376
391
|
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
|
377
392
|
}
|
378
393
|
else if(existingRequest) {
|
379
394
|
module.debug('Content is already loading', fullTabPath);
|
380
|
-
$tab
|
381
|
-
.addClass(className.loading)
|
382
|
-
;
|
395
|
+
$tab.addClass(className.loading);
|
383
396
|
}
|
384
397
|
else if($.api !== undefined) {
|
385
|
-
requestSettings = $.extend(true, {
|
398
|
+
requestSettings = $.extend(true, {
|
399
|
+
headers: { 'X-Remote': true }
|
400
|
+
}, settings.apiSettings, apiSettings);
|
386
401
|
module.debug('Retrieving remote content', fullTabPath, requestSettings);
|
387
|
-
|
402
|
+
$tab.api( requestSettings );
|
388
403
|
}
|
389
404
|
else {
|
390
405
|
module.error(error.api);
|
@@ -705,7 +720,7 @@ $.fn.tab = function(parameters) {
|
|
705
720
|
}
|
706
721
|
else {
|
707
722
|
if(instance !== undefined) {
|
708
|
-
|
723
|
+
instance.invoke('destroy');
|
709
724
|
}
|
710
725
|
module.initialize();
|
711
726
|
}
|