Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
22165923
Commit
22165923
authored
Mar 29, 2018
by
Sergey Antonovich
🇯🇵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
custom-button.conf
parent
83beb018
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
form-cmp/custom-button.conf.xml
form-cmp/custom-button.conf.xml
+64
-0
No files found.
form-cmp/custom-button.conf.xml
0 → 100644
View file @
22165923
<?xml version="1.0" encoding="utf-8"?>
<configuration
version=
"1"
date=
"2018-03-29 17:03:00"
synergyVersion=
"3.15"
>
<objects
version=
"1"
date=
"2018-03-29 17:03:00"
synergyVersion=
"3.15"
>
<customComponent
code=
"button"
name=
"button by [0x00034]"
use_in_forms=
"true"
>
<javascript>
/*
Example code:
model.setValue('Простая кнопка');
model.click = function(){
console.log('click');
};
model.mousedown = function(){
console.log('mousedown');
};
model.mouseup = function(){
console.log('mouseup');
};
model.mouseenter = function(){
console.log('mouseenter');
};
model.mouseleave = function(){
console.log('mouseleave');
};
##
# Events:
##
click - При клике
mousedown - При зажатие
mouseup - После отжатия
mouseenter - При наведении
mouseleave - После наведения
Code by yandexphp
*/
model.getAsfData = function (blockNumber) {
if(model.getValue()){
var valueObject = JSON.stringify(model.getValue());
return AS.FORMS.ASFDataUtils.getBaseAsfData(model.asfProperty, blockNumber, valueObject, valueObject);
}else{
return AS.FORMS.ASFDataUtils.getBaseAsfData(model.asfProperty, blockNumber);
}
};
model.setAsfData = function(asfData){
if(!asfData || !asfData.value) return;
model.setValue(JSON.parse(asfData.value));
};
$(view.container).find('.GNTJMDODMR').hover(
function(){$(this).addClass('GNTJMDODPO');},
function(){$(this).removeClass('GNTJMDODPO');}
);
view.updateValueFromModel = function(){
['click','mousedown','mouseup','mouseenter','mouseleave'].forEach(function(item){
if((item in model) === false) return;
$(view.container).find('.custom-button-synergy').off(item);
$(view.container).find('.custom-button-synergy').on(item,model[item]);
});
if(model.getValue()) $(view.container).find('span').text(""+model.getValue());
};
view.updateValueFromModel();
</javascript>
<html>
<
div class="GNTJMDODHJ GNTJMDODMR custom-button-synergy" style="width: 100%;cursor:pointer;"
><
div class="GNTJMDODNJ GNTJMDODDO" style="font-size: 0px; overflow: hidden; padding: 0px;margin: 0 7px 0 7px;"
><
span class="GNTJMDODDO"
><
/span
><
/div
><
/div
>
</html>
</customComponent>
</objects>
<dependencies/>
</configuration>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment