2012-10-11 17:01:49 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Javascript behaviors for the Book module.
|
|
|
|
*/
|
|
|
|
|
2009-04-27 20:19:38 +00:00
|
|
|
(function ($) {
|
2009-04-11 22:19:46 +00:00
|
|
|
|
2012-05-08 02:57:33 +00:00
|
|
|
"use strict";
|
|
|
|
|
2012-11-27 07:06:47 +00:00
|
|
|
Drupal.behaviors.bookDetailsSummaries = {
|
2009-04-27 20:19:38 +00:00
|
|
|
attach: function (context) {
|
2012-11-27 07:06:47 +00:00
|
|
|
$(context).find('.book-outline-form').drupalSetSummary(function (context) {
|
2012-06-24 19:35:52 +00:00
|
|
|
var $select = $(context).find('.book-title-select');
|
2012-02-03 21:15:50 +00:00
|
|
|
var val = $select.val();
|
2009-04-11 22:19:46 +00:00
|
|
|
|
|
|
|
if (val === '0') {
|
|
|
|
return Drupal.t('Not in book');
|
|
|
|
}
|
|
|
|
else if (val === 'new') {
|
|
|
|
return Drupal.t('New book');
|
|
|
|
}
|
|
|
|
else {
|
2012-02-03 21:15:50 +00:00
|
|
|
return Drupal.checkPlain($select.find(':selected').text());
|
2009-04-11 22:19:46 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
})(jQuery);
|