зеркало из https://github.com/mozilla/pjs.git
Don't add new attribute if value is empty in Composer Advanced Edit dialog, r=96906, r=brade, sr=hewitt
This commit is contained in:
Родитель
bbd838172b
Коммит
b556aab536
|
@ -56,7 +56,6 @@ function BuildCSSAttributeTable()
|
|||
ClearCSSInputWidgets();
|
||||
}
|
||||
|
||||
// add or select attribute in the tree widget
|
||||
function onChangeCSSAttribute()
|
||||
{
|
||||
var name = TrimString(gDialog.AddCSSAttributeNameInput.value);
|
||||
|
@ -67,7 +66,7 @@ function onChangeCSSAttribute()
|
|||
|
||||
// First try to update existing attribute
|
||||
// If not found, add new attribute
|
||||
if ( !UpdateExistingAttribute( name, value, "CSSAList" ) )
|
||||
if ( !UpdateExistingAttribute( name, value, "CSSAList" ) && value)
|
||||
AddTreeItem( name, value, "CSSAList", CSSAttrs );
|
||||
}
|
||||
|
||||
|
@ -104,14 +103,6 @@ function onInputCSSAttributeName()
|
|||
gDialog.AddCSSAttributeValueInput.value = newValue;
|
||||
}
|
||||
|
||||
function onInputCSSAttributeValue()
|
||||
{
|
||||
// Update value in the tree list
|
||||
UpdateExistingAttribute( gDialog.AddCSSAttributeNameInput.value,
|
||||
gDialog.AddCSSAttributeValueInput.value,
|
||||
"CSSAList" );
|
||||
}
|
||||
|
||||
function editCSSAttributeValue(targetCell)
|
||||
{
|
||||
if (IsNotTreeHeader(targetCell))
|
||||
|
|
|
@ -163,7 +163,7 @@ function onInputJSEAttributeValue()
|
|||
// Update value in the tree list
|
||||
// Since we have a non-editable menulist,
|
||||
// we MUST automatically add the event attribute if it doesn't exist
|
||||
if (!UpdateExistingAttribute( name, value, "JSEAList" ))
|
||||
if (!UpdateExistingAttribute( name, value, "JSEAList" ) && value)
|
||||
AddTreeItem( name, value, "JSEAList", JSEAttrs );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@
|
|||
oninput="onInputCSSAttributeName();"
|
||||
onchange="onChangeCSSAttribute();"/>
|
||||
<textbox id="AddCSSAttributeValueInput" flex="1"
|
||||
oninput="onInputCSSAttributeValue();"/>
|
||||
oninput="onChangeCSSAttribute();"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
|
Загрузка…
Ссылка в новой задаче