#193274 by dmitrig01 and quicksketch: send submit button data with AHAH submissions
parent
8ebc345b9d
commit
c40af9443d
|
@ -1614,7 +1614,6 @@ function expand_radios($element) {
|
||||||
*/
|
*/
|
||||||
function form_expand_ahah($element) {
|
function form_expand_ahah($element) {
|
||||||
static $js_added = array();
|
static $js_added = array();
|
||||||
|
|
||||||
// Add a reasonable default event handler if none specified.
|
// Add a reasonable default event handler if none specified.
|
||||||
if (isset($element['#ahah']['path']) && !isset($element['#ahah']['event'])) {
|
if (isset($element['#ahah']['path']) && !isset($element['#ahah']['event'])) {
|
||||||
switch ($element['#type']) {
|
switch ($element['#type']) {
|
||||||
|
@ -1650,6 +1649,7 @@ function form_expand_ahah($element) {
|
||||||
'effect' => empty($element['#ahah']['effect']) ? 'none' : $element['#ahah']['effect'],
|
'effect' => empty($element['#ahah']['effect']) ? 'none' : $element['#ahah']['effect'],
|
||||||
'method' => empty($element['#ahah']['method']) ? 'replace' : $element['#ahah']['method'],
|
'method' => empty($element['#ahah']['method']) ? 'replace' : $element['#ahah']['method'],
|
||||||
'progress' => empty($element['#ahah']['progress']) ? array('type' => 'throbber') : $element['#ahah']['progress'],
|
'progress' => empty($element['#ahah']['progress']) ? array('type' => 'throbber') : $element['#ahah']['progress'],
|
||||||
|
'button' => $element['#type'] == 'submit' ? array($element['#name'] => $element['#value']) : FALSE,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Convert a simple #ahah[progress] type string into an array.
|
// Convert a simple #ahah[progress] type string into an array.
|
||||||
|
|
|
@ -43,6 +43,8 @@ Drupal.ahah = function(base, element_settings) {
|
||||||
this.effect = element_settings.effect;
|
this.effect = element_settings.effect;
|
||||||
this.method = element_settings.method;
|
this.method = element_settings.method;
|
||||||
this.progress = element_settings.progress;
|
this.progress = element_settings.progress;
|
||||||
|
this.button = element_settings.button || { };
|
||||||
|
|
||||||
if (this.effect == 'none') {
|
if (this.effect == 'none') {
|
||||||
this.showEffect = 'show';
|
this.showEffect = 'show';
|
||||||
this.hideEffect = 'hide';
|
this.hideEffect = 'hide';
|
||||||
|
@ -70,6 +72,7 @@ Drupal.ahah = function(base, element_settings) {
|
||||||
var ahah = this;
|
var ahah = this;
|
||||||
var options = {
|
var options = {
|
||||||
url: ahah.url,
|
url: ahah.url,
|
||||||
|
data: ahah.button,
|
||||||
beforeSubmit: function(form_values, element_settings, options) {
|
beforeSubmit: function(form_values, element_settings, options) {
|
||||||
return ahah.beforeSubmit(form_values, element_settings, options);
|
return ahah.beforeSubmit(form_values, element_settings, options);
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue