Skip to content
Snippets Groups Projects
Commit f6b49bf5 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Bring diffs closer and fix copy paste typos.

parent d8da26bc
No related merge requests found
......@@ -145,6 +145,7 @@ class RecordActionsTest extends \VuFindTest\Unit\MinkTestCase
// Go to a record view
$page = $this->gotoRecord();
// Click to add tag
$this->snooze();
$this->findCss($page, '.tag-record')->click();
$this->snooze();
// Lightbox login open?
......
......@@ -72,6 +72,25 @@ function lessFacets(id) {
$('#more-'+id).removeClass('hidden');
}
// Phone number validation
function phoneNumberFormHandler(numID, regionCode) {
var phoneInput = document.getElementById(numID);
var number = phoneInput.value;
var valid = isPhoneNumberValid(number, regionCode);
if(valid != true) {
if(typeof valid === 'string') {
valid = VuFind.translate(valid);
} else {
valid = VuFind.translate('libphonenumber_invalid');
}
$(phoneInput).siblings('.help-block.with-errors').html(valid);
$(phoneInput).closest('.form-group').addClass('sms-error');
} else {
$(phoneInput).closest('.form-group').removeClass('sms-error');
$(phoneInput).siblings('.help-block.with-errors').html('');
}
}
// Lightbox
/*
* This function adds jQuery events to elements in the lightbox
......@@ -102,25 +121,6 @@ function bulkActionSubmit($form) {
return false;
}
// Phone number validation
function phoneNumberFormHandler(numID, regionCode) {
var phoneInput = document.getElementById(numID);
var number = phoneInput.value;
var valid = isPhoneNumberValid(number, regionCode);
if(valid != true) {
if(typeof valid === 'string') {
valid = VuFind.translate(valid);
} else {
valid = VuFind.translate('libphonenumber_invalid');
}
$(phoneInput).siblings('.help-block.with-errors').html(valid);
$(phoneInput).closest('.form-group').addClass('sms-error');
} else {
$(phoneInput).closest('.form-group').removeClass('sms-error');
$(phoneInput).siblings('.help-block.with-errors').html('');
}
}
function registerLightboxEvents() {
var modal = $("#modal");
// New list
......@@ -221,12 +221,12 @@ function ajaxLogin(form) {
data: params,
success: function(response) {
if (response.status == 'OK') {
Lightbox.addCloseAction(refreshPageForLogin);
// and we update the modal
var params = deparam(Lightbox.lastURL);
if (params['subaction'] == 'UserLogin') {
refreshPageForLogin();
Lightbox.close();
} else {
Lightbox.addCloseAction(refreshPageForLogin);
Lightbox.getByUrl(
Lightbox.lastURL,
Lightbox.lastPOST,
......@@ -333,6 +333,12 @@ function setupAutocomplete() {
}
);
});
// Update autocomplete on type change
$('.searchForm_type').change(function() {
var $lookfor = $(this).closest('.searchForm').find('.searchForm_lookfor[name]');
var query = $lookfor.val();
$lookfor.focus().typeahead('val', '').typeahead('val', query);
});
}
$(document).ready(function() {
......
......@@ -274,6 +274,8 @@ function setupRecordToolbar(target) {
}
function recordDocReady() {
registerTabEvents();
$('.record-tabs .nav-tabs a').click(function (e) {
if ($(this.parentNode).hasClass('active')) {
return true;
......
......@@ -95,4 +95,4 @@
</div>
<? endif; ?>
</div>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready( recordDocReady );', 'SET'); ?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?>
......@@ -89,4 +89,4 @@
<? endforeach; ?>
</div>
</div>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready( recordDocReady );', 'SET'); ?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment