mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding 'style' as a known html attribute. Fixes #1573
This commit is contained in:
parent
2e76d32cf9
commit
7853189328
2 changed files with 6 additions and 3 deletions
|
@ -428,7 +428,10 @@ class JsHelper extends AppHelper {
|
|||
* @access protected
|
||||
*/
|
||||
function _getHtmlOptions($options, $additional = array()) {
|
||||
$htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional);
|
||||
$htmlKeys = array_merge(
|
||||
array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title', 'style'),
|
||||
$additional
|
||||
);
|
||||
$htmlOptions = array();
|
||||
foreach ($htmlKeys as $key) {
|
||||
if (isset($options[$key])) {
|
||||
|
|
|
@ -402,7 +402,7 @@ CODE;
|
|||
function testSubmitWithMock() {
|
||||
$this->_useMock();
|
||||
|
||||
$options = array('update' => '#content', 'id' => 'test-submit');
|
||||
$options = array('update' => '#content', 'id' => 'test-submit', 'style' => 'margin: 0');
|
||||
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'serialize-code', array('serializeform', '*'));
|
||||
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'serialize-code', array('serializeForm', '*'));
|
||||
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'ajax-code', array('request', '*'));
|
||||
|
@ -422,7 +422,7 @@ CODE;
|
|||
$result = $this->Js->submit('Save', $options);
|
||||
$expected = array(
|
||||
'div' => array('class' => 'submit'),
|
||||
'input' => array('type' => 'submit', 'id' => $options['id'], 'value' => 'Save'),
|
||||
'input' => array('type' => 'submit', 'id' => $options['id'], 'value' => 'Save', 'style' => 'margin: 0'),
|
||||
'/div'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
|
Loading…
Reference in a new issue