* Code refactors in module dev/js .
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
.ml-20 {margin-left: 20px;}
|
||||
.title {font-size: 13px; color: #313C52; font-weight: 700; height: 40px; text-align: center;}
|
||||
.gap-15 {gap: 15px;}
|
||||
.h-full {height: 100%;}
|
||||
|
||||
/* menu-tree */
|
||||
.menu-tree {flex: 0 0 200px; background: #fff; padding: 10px 10px;}
|
||||
@@ -15,16 +16,18 @@
|
||||
li.has-list > ul > li {padding-left: 10px;}
|
||||
.tree ul {margin-bottom: 0;}
|
||||
|
||||
/* side-left */
|
||||
.main-content > .side-left {flex: 0 0 160px; margin-left: 44px;}
|
||||
.label-list {background: #F8F8F8; padding: 5px 0;}
|
||||
.label-list > .input-label {display: flex; align-items: center; cursor: pointer; padding-left: 40px;}
|
||||
|
||||
/* side-right */
|
||||
.main-content > .side-right {margin-left: 50px;}
|
||||
.main-content > .side-right > .input-list {padding: 5px 0;}
|
||||
.main-content > .side-right > .input-list > .input-control {position: relative;}
|
||||
.main-content > .side-right > .input-list > .input-control > i.icon {position: absolute; font-size: 25px; left: -40px; top: 3px;}
|
||||
/* title-content */
|
||||
.title-content {gap: 20px;}
|
||||
.title-content > .title {margin-left: 44px; width: 160px;}
|
||||
|
||||
/* form-content */
|
||||
.form-item-content {padding-left: 44px;}
|
||||
.form-item-content > .form-item {gap: 20px; height: 56px; align-items: center; position: relative;}
|
||||
.form-item-content > .form-item > .input-label {flex: 0 0 160px; padding-left: 40px; background: #F8F8F8; display: flex; align-items: center;}
|
||||
.form-item-content > .form-item > .input-control > input {margin-left: 40px;}
|
||||
.form-item-content > .form-item.active > .icon {display: unset;}
|
||||
.form-item-content > .form-item> .icon {display: none; position: absolute; left: 180px; font-size: 25px;}
|
||||
|
||||
/* bottom-btn */
|
||||
.bottom-btn {display: flex; align-items: center; background: #fff;padding-left: 150px; padding-bottom: 20px;}
|
||||
|
||||
+16
-11
@@ -9,8 +9,7 @@ $(function()
|
||||
*/
|
||||
function addActive(id)
|
||||
{
|
||||
$('[labelid=' + id + ']').addClass('text-primary');
|
||||
$('[iconid=' + id + ']').removeClass('hidden');
|
||||
$('[itemid=' + id + ']').addClass('text-primary active');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,8 +21,7 @@ $(function()
|
||||
*/
|
||||
function removeActive(id)
|
||||
{
|
||||
$('[labelid=' + id + ']').removeClass('text-primary');
|
||||
$('[iconid=' + id + ']').addClass('hidden');
|
||||
$('[itemid=' + id + ']').removeClass('text-primary active');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,10 +33,10 @@ $(function()
|
||||
*/
|
||||
function handleClickItem(clickId)
|
||||
{
|
||||
var clearId = $('.label-list > .text-primary').attr('labelid');
|
||||
var clearId = $('.form-item.active').attr('itemid');
|
||||
if(clearId !== clickId)
|
||||
{
|
||||
if(clearId) removeActive(clearId);
|
||||
if(clearId) removeActive(clearId);
|
||||
if(clickId) addActive(clickId);
|
||||
};
|
||||
}
|
||||
@@ -97,7 +95,6 @@ $(function()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -127,12 +124,11 @@ $(function()
|
||||
{
|
||||
var target = $(e.target);
|
||||
if (target.attr('data-has-children') === 'true') return;
|
||||
|
||||
self.location.href = createLink('dev', 'langItem', 'type=' + type + '&module=' + target.attr('data-module') + '&method=' + target.attr('data-method'));
|
||||
})
|
||||
}
|
||||
|
||||
$(".input-list").on("click", 'input', function(e)
|
||||
$(".form-item-content").on("click", 'input', function(e)
|
||||
{
|
||||
handleClickItem(e.target.id);
|
||||
}).on("blur", 'input', function(e)
|
||||
@@ -140,13 +136,22 @@ $(function()
|
||||
removeActive(e.target.id);
|
||||
});
|
||||
|
||||
$('.label-list > .input-label').on('click', function()
|
||||
$('.form-item-content > .form-item > .input-label').on('click', function()
|
||||
{
|
||||
handleClickItem($(this).attr('labelid'));
|
||||
});
|
||||
|
||||
$(".form-item-content").on('mouseover', '.form-item', function()
|
||||
{
|
||||
if ($(this).hasClass('text-primary')) return;
|
||||
$(this).addClass('text-primary');
|
||||
}).on('mouseout', '.form-item', function()
|
||||
{
|
||||
$(this).removeClass('text-primary');
|
||||
})
|
||||
|
||||
initMenu();
|
||||
handleInputSearch();
|
||||
|
||||
$('li.has-list > ul').addClass("menu-active-primary menu-hover-primary")
|
||||
$('li.has-list > ul').addClass("menu-active-primary menu-hover-primary");
|
||||
})
|
||||
|
||||
@@ -39,45 +39,38 @@
|
||||
<?php if(in_array($type, $config->dev->navTypes)):?>
|
||||
<div class="menu-tree">
|
||||
<div class="input-control search-box has-icon-left has-icon-right search-example">
|
||||
<input type="search" class="form-control search-input" />
|
||||
<input type="search" class="form-control search-input"/>
|
||||
<label class="input-control-icon-left search-icon flex align-center justify-center"><i class="icon icon-search"></i></label>
|
||||
</div>
|
||||
<div id="menuTree" class="menu-active-primary menu-hover-primary"></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<form class='main-form form-ajax flex-1' method='post'>
|
||||
<div id='mainContent' class='main-content flex'>
|
||||
<?php if(str_replace('-', '_', $this->app->getClientLang()) != $language):?>
|
||||
<div class="side-left">
|
||||
<div class="title"><?php echo $lang->dev->currentLang;?> </div>
|
||||
<div class="label-list">
|
||||
<?php foreach($currentLangs as $langKey => $originalLang):?>
|
||||
<div labelId="<?php echo "{$moduleName}_{$langKey}"?>" class="input-label h-32 my-12"><?php echo $originalLang?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="side-left">
|
||||
<div class="title"><?php echo $lang->dev->defaultValue ?> </div>
|
||||
<div class="label-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div labelId="<?php echo "{$moduleName}_{$langKey}"?>" class="input-label h-32 my-12"><?php echo $originalLang?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side-right">
|
||||
<div class="main-content">
|
||||
<div class="title-content flex">
|
||||
<?php if(str_replace('-', '_', $this->app->getClientLang()) != $language):?>
|
||||
<div class="title"><?php echo $lang->dev->currentLang;?> </div>
|
||||
<?php endif;?>
|
||||
<div class="title"><?php echo $lang->dev->defaultValue?></div>
|
||||
<div class="title"><?php echo $lang->dev->modifyValue?></div>
|
||||
<div class="input-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div class="input-control h-32 my-12">
|
||||
<?php echo html::input("{$moduleName}_{$langKey}", zget($customedLangs, $langKey, ''), "class='form-control shadow-primary-hover' placeholder='{$originalLang}'");?>
|
||||
<i iconId="<?php echo "{$moduleName}_{$langKey}"?>" class="icon icon-angle-right text-primary hidden"></i>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side-main"></div>
|
||||
<div class="form-item-content">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div itemid="<?php echo "{$moduleName}_{$langKey}"?>" class="form-item flex">
|
||||
<?php if(str_replace('-', '_', $this->app->getClientLang()) != $language):?>
|
||||
<div labelId="<?php echo "{$moduleName}_{$langKey}"?>" class="input-label h-full"><?php echo $originalLang?></div>
|
||||
<?php endif;?>
|
||||
<div labelId="<?php echo "{$moduleName}_{$langKey}"?>" class="input-label h-full"><?php echo $originalLang?></div>
|
||||
<i class="icon icon-angle-right text-primary"></i>
|
||||
<div class="input-control">
|
||||
<?php echo html::input("{$moduleName}_{$langKey}", zget($customedLangs, $langKey, ''), "class='form-control shadow-primary-hover' placeholder='{$originalLang}'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bottom-btn">
|
||||
<?php echo html::submitButton(); ?>
|
||||
<?php echo html::a(inlink('resetLang', "type={$type}&module={$moduleName}&language={$language}"), $lang->restore, 'hiddenwin', "id='reset' class='btn btn-wide ml-20'");?>
|
||||
|
||||
Reference in New Issue
Block a user