|
@@ -22,6 +22,7 @@
|
|
|
var _is_loggedin = drupalSettings.user.uid === 0 ? false : true;
|
|
|
var _$log_form;
|
|
|
var _user_tokens;
|
|
|
+ var _states_history = [];
|
|
|
|
|
|
|
|
|
|
|
@@ -366,7 +367,14 @@
|
|
|
}else{
|
|
|
_$row.append($rendered);
|
|
|
}
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ else if(
|
|
|
+ (state.context == 'document-transcript' || state.context == 'document-artcile')
|
|
|
+ && state.caller == "search"
|
|
|
+ ){
|
|
|
+ _$row.append($rendered);
|
|
|
+ }
|
|
|
+ else{
|
|
|
_$row.removeAttr('style').html($rendered);
|
|
|
}
|
|
|
|
|
@@ -514,15 +522,12 @@
|
|
|
_$body.removeClass('ajax-loading');
|
|
|
|
|
|
|
|
|
+
|
|
|
+ _states_history.unshift(state);
|
|
|
+
|
|
|
|
|
|
|
|
|
if(state.url){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
history.pushState(state, null, state.url);
|
|
|
|
|
@@ -584,6 +589,55 @@
|
|
|
|
|
|
function onCloseModal(e){
|
|
|
console.log("onCloseModal");
|
|
|
+
|
|
|
+
|
|
|
+ console.log("onCloseModal _states_history",_states_history);
|
|
|
+ if(['document-transcript', 'document-article'].indexOf(_states_history[0].context) != -1)
|
|
|
+ {
|
|
|
+ if (_states_history[0].caller == "production") {
|
|
|
+ for (var i = 0; i < _states_history.length; i++) {
|
|
|
+ if (_states_history[i].context == "production") {
|
|
|
+
|
|
|
+ console.log("onCloseModal return to production", _states_history[i]);
|
|
|
+ ajaxLoadContent(_states_history[i]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (_states_history[0].caller == "entree-index") {
|
|
|
+ for (var i = 0; i < _states_history.length; i++) {
|
|
|
+ if (_states_history[i].context == "entree-index") {
|
|
|
+ console.log("onCloseModal return to entree-index", _states_history[i]);
|
|
|
+ ajaxLoadContent(_states_history[i]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (_states_history[0].caller == "entree-notice") {
|
|
|
+ for (var i = 0; i < _states_history.length; i++) {
|
|
|
+ if (_states_history[i].context == "entree-notice") {
|
|
|
+ console.log("onCloseModal return to entree-notice", _states_history[i]);
|
|
|
+ ajaxLoadContent(_states_history[i]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
var $col = $(this).parents('.col');
|
|
|
var theme = $col.attr('theme');
|
|
@@ -882,6 +936,64 @@
|
|
|
state.url += "#"+view_mode;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ var contexts = /^.*\/(productions|documents|entrees|search)(\/.*)?/g.exec(state.url);
|
|
|
+ console.log("onClickAjaxLink contexts", contexts);
|
|
|
+ if(contexts){
|
|
|
+ switch (contexts[1]) {
|
|
|
+ case 'productions':
|
|
|
+
|
|
|
+
|
|
|
+ state.context = "production"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 'entrees':
|
|
|
+ switch(view_mode) {
|
|
|
+ case 'index':
|
|
|
+ state.context = "entree-index";
|
|
|
+ break;
|
|
|
+ case 'notice':
|
|
|
+ state.context = "entree-notice";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 'search':
|
|
|
+ state.context = "search";
|
|
|
+ break;
|
|
|
+ case 'documents':
|
|
|
+
|
|
|
+ switch (view_mode) {
|
|
|
+ case 'transcript':
|
|
|
+ state.context = "document-transcript";
|
|
|
+ break;
|
|
|
+ case 'article':
|
|
|
+ state.context = "document-article";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ state.context = "document";
|
|
|
+ }
|
|
|
+
|
|
|
+ if(typeof _states_history[0] != "undefined"){
|
|
|
+ if(_states_history[0].caller){
|
|
|
+ state.caller = _states_history[0].caller
|
|
|
+ }else{
|
|
|
+ state.caller = _states_history[0].context
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ state.caller = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ state.context = null;
|
|
|
+ state.context = caller;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if($link.is('[selector]')){
|
|
|
state.selector = $link.attr('selector');
|
|
|
}
|
|
@@ -1308,7 +1420,7 @@
|
|
|
.fail(this.onNodeLoadFail.bind(this));
|
|
|
},
|
|
|
onNodeLoaded(data){
|
|
|
- console.log('AudioPlayer node loaded', data);
|
|
|
+ console.log('AudioPlayer node loaded');
|
|
|
this.$cartel.html(data.rendered).removeClass('loading');
|
|
|
_$body.trigger({'type':'new-audio-cartel-loaded'});
|
|
|
initAjaxLinks();
|